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

Real Simple Grid Edit Question

1 Answer 53 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mpaul
Top achievements
Rank 1
mpaul asked on 15 Dec 2010, 06:24 PM
I have a real simple scenario, but I am a little unclear on how to approach. I need to have my grid insert and edit records. Note, I will not being using and datasource controls, so I will be handlings on the server. Basically, I have two string columns. When creating a new record, both are editable. When editing an existing record, only the second string is editable. So, I am wondering how to have the grid controls render two textbox's on insert, but only one on edit?

Thanks

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 16 Dec 2010, 05:28 AM
Hello,


Try out the following code to get the functionality.

Code:
protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
    if (e.Item is GridEditableItem && e.Item.IsInEditMode && !e.Item.OwnerTableView.IsItemInserted)
    {
        ((GridEditableItem)e.Item)["ColumnUniqueName"].Controls[0].Visible = false;
    }
}



-Shinu.
Tags
Grid
Asked by
mpaul
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or