I have added a new event which is double click, and that event will be fired in a CallBack, everything now works fine, except that, I need to set the Grid in the Edit Mode. The method below is called from the RaiseCallBackEvent method, it is setting the
SelectedIndex right, but the problem is that, the Row is not set in the EditMode.
Am I missing anything?
protected virtual void OnRowDoubleClick(RowDoubleClickEventArgs e)
{
// Set a selection in the Grid
int rowIndex = e.GridViewRow.RowIndex;
// Select the row
this.SelectedIndex = rowIndex;
// Set the edit row
this.EditIndex = rowIndex;
// Change the row state
this.Rows[rowIndex].RowState = DataControlRowState.Edit;
RowDoubleClickEventHandler handler1 = (RowDoubleClickEventHandler)base.Events[xGrid.EventRowDoubleClick];
if (handler1 != null)
{
handler1(this, e);
}
}
haidar_bilal
All-Star
45609 Points
8730 Posts
MVP
Put GridView in Edit Mode Programmatically
Jun 22, 2006 11:20 AM|LINK
Hello:
I am developing an extended GridView.
I have added a new event which is double click, and that event will be fired in a CallBack, everything now works fine, except that, I need to set the Grid in the Edit Mode. The method below is called from the RaiseCallBackEvent method, it is setting the SelectedIndex right, but the problem is that, the Row is not set in the EditMode.
Am I missing anything?
protected virtual void OnRowDoubleClick(RowDoubleClickEventArgs e) { // Set a selection in the Grid int rowIndex = e.GridViewRow.RowIndex; // Select the row this.SelectedIndex = rowIndex; // Set the edit row this.EditIndex = rowIndex; // Change the row state this.Rows[rowIndex].RowState = DataControlRowState.Edit; RowDoubleClickEventHandler handler1 = (RowDoubleClickEventHandler)base.Events[xGrid.EventRowDoubleClick]; if (handler1 != null) { handler1(this, e); } }Thanks a lot.
Professional ASP.NET 3.5 Security, Membership, and Role Management with C# and VB