DataGrid control processing in the contents of the content

xiaoxiao2021-03-06  93

DataGrid control processing in the contents of the content

// ...

/ / Define DataGrid

Protected DataGrid MyDataGrid;

// ...

// ...

/ / Respond to the itemcreated event of DataGrid

MyDataGrid.Itemcreated = new system.Web.ui.WebControls.DataGriditeMeventHandler (this.DataGrid_Itemcreated);

// ...

// ...

/ / Respond to the specific method of itemcreated

// This method responds when each line is created

Private void DataGrid_Itemcreated (Object Sender, System.Web.ui.WebControls.DataGriditeMeventargs E)

{// Here, E.Item returns the object of the current creation line

For (int i = 0; i

{// E.Item.cells [x] is the cell in the current line

E.Item.cells [i] .wrap = false;

}

}

转载请注明原文地址:https://www.9cbs.com/read-95396.html

New Post(0)