.Net Links

Thursday, October 22, 2009

Event that is triggered when New is clicked in the Devexpress grid view

The below piece of code enables us to initialize added rows.

ASPxGridView grid= new ASPxGridView();
grid.InitNewRow += new DevExpress.Web.Data.ASPxDataInitNewRowEventHandler(grid_RowInserting);

You can then Call the grid_RowInserting ..So on clicking on the New Link in the Grid, the control is passed on to this function.

Here i have tried to make the columns 2,3 as readonly and column 6 visibility as false

void grid_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInitNewRowEventArgs e)
{


((GridViewDataColumn)grid.Columns[2]).ReadOnly = true;
((GridViewDataColumn) grid.Columns[3]).ReadOnly = true;
((GridViewDataColumn) grid.Columns[6]).EditFormSettings.Visible = DevExpress.Web.ASPxClasses.DefaultBoolean.False;

}

Labels: , , , , , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]



<< Home