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

[Solved] How to set RadGrid in edit mode onload and at runtime?

1 Answer 380 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Virendra
Top achievements
Rank 1
Virendra asked on 29 Jul 2009, 11:10 PM
Hi,

I want my RadGrid to be loaded in EditMode, e.g. first row should be edit mode when grid got loaded.

i tried
protected void RadGrid1_DataBound(object sender, EventArgs e)
{
RadGrid radGrid = sender as RadGrid;
if (!radGrid.Items[0].IsInEditMode)
{
radGrid .Items[0].Edit = true;
//radGrid.Rebind();  
}
}

but never loaded in edit mode.

Part 2 of the question, can we set focue to a given cell when it moves in edit mode.

thanks
virendra 

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 30 Jul 2009, 04:04 AM
Hi Virendra,

Try the following code snippet in the PreRender event of the Grid.

CS:
 
 protected void RadGrid1_PreRender(object sender, EventArgs e) 
    { 
        RadGrid1.Items[0].Edit = true
        RadGrid1.Rebind(); 
    } 

I guess you are trying to set focus to a Grid cell in edit mode. If so go through the following help article and see whether it helps.
Focus the text boxes in the edit control

Regards
Princy.
Tags
Grid
Asked by
Virendra
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or