This is a migrated thread and some comments may be shown as answers.

Custom insert item form on grid

2 Answers 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bogdan
Top achievements
Rank 1
Bogdan asked on 08 Jan 2011, 08:29 PM
We are using a combination of RadToolBar as Command Item (http://demos.telerik.com/aspnet-ajax/toolbar/examples/applicationscenarios/gridcommanditem/defaultcs.aspx?product=grid) and custom styled edited rows (http://demos.telerik.com/aspnet-ajax/grid/examples/styles/editrowstyle/defaultcs.aspx) to display grid with users information.  Passwords are not displayed in the grid and are not available for editing, but we have to have password field available at the time of new user creation.  Any tips as to how we can make this happen?

Thank you!

2 Answers, 1 is accepted

Sort by
0
Mike Nogen
Top achievements
Rank 1
answered on 08 Jan 2011, 09:11 PM
Hello!

Could this work for you. Hide the password in edit mode but show the item in insert mode.

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
        
            if (e.Item is GridEditableItem && e.Item.IsInEditMode) 
            
                GridEditableItem item = (GridEditableItem)e.Item; 
    
                if (e.Item is GridEditFormInsertItem) 
                
                    //In insert mode
                    item["Password"].Visible = true
                
                else
                
                    //In Edit mode
                    item["Password"].Visible = false
                
            
        }

/M


0
Bogdan
Top achievements
Rank 1
answered on 09 Jan 2011, 06:42 PM
This worked, thank you for your help.
Tags
Grid
Asked by
Bogdan
Top achievements
Rank 1
Answers by
Mike Nogen
Top achievements
Rank 1
Bogdan
Top achievements
Rank 1
Share this question
or