List not appear but when edit data will save

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
bani06
User
Posts: 38

List not appear but when edit data will save

Post by bani06 »

Hi,

How to make column edited not appear in list page but when edit or add it will save in database?
Eg.
I have column Name and PassportID.
I have set PassportID will autoFill when select Name. I dont want Passport ID show in list view. Current now, if i dont want passprtID show in List Page it would not save in database.


MichaelG
User
Posts: 1121

Post by MichaelG »

Do you mean you want to hide the fields in list page but show the fields in grid or inline add/edit in list page? If yes, you can use FieldVisibility extension (Tools -> Extensions -> FieldVisibility) to show/hide the fields for list page / grid / inline add/edit.


bani06
User
Posts: 38

Post by bani06 »

can i do another way by not using this fieldVisibility extension?


MichaelG
User
Posts: 1121

Post by MichaelG »

You can use the Page_Load server event to set the field's visibility. For example:

if (<condition>) // Hide field based on condition
Field.Visible = false;


bani06
User
Posts: 38

Post by bani06 »

I habe use this code

Field.visible = false. The problem is when in edit page, it doesnt show.


MichaelG
User
Posts: 1121

Post by MichaelG »

As explained, you need to add your condition checking to set the field's visibility.

if (<condition>) // Hide field based on condition
Field.Visible = false;

For example, if you want to hide the field if not inline edit, use:

if (!IsEdit) // Hide if not inline edit
Field.Visible = false;


bani06
User
Posts: 38

Post by bani06 »

Thanks. Works ok. But if i'm using default value for username =@currentusername it doesnt work.
EG:
if (!IsEdit) // Hide if not inline edit
RESULT.Visible = false; (OK)
Username.Visible = false; (Not Ok. this value using Auto update value =CurrentUserName() )


MichaelG
User
Posts: 1121

Post by MichaelG »

Auto-Update fields are always hidden in add/edit. If you want to show the fields in add/edit page, you should remove the Auto-Update Value settings. Use the Row_Rendered server event instead to set a default value.


rebazhama
User
Posts: 1

Post by rebazhama »

yes....that is right

soran.edu.iq


Post Reply