Project encountered, under Baidu, as follows:
ProtectedvoidGVList_RowDataBound (objectsender, GridViewRowEventArgse)
{
// Hide unnecessary Columns
If (e. row. rowType = DataControlRowType. dataRow) | (e. row. rowType = DataControlRowType. header) | (e. row. rowType = DataControlRowType. footer ))
{
E. Row. Cells [0]. Visible = false;
E. Row. Cells [3]. Visible = false;
}
}
Write the following code in the RowCreated event:
VoidGridView1_RowCreated (objectsender, GridViewRowEventArgse)
{
If (e. Row. RowType = DataControlRowType. DataRow |
E. Row. RowType = DataControlRowType. Header)
{
E. Row. Cells [0]. Visible = false; // if you want to make the 1st column invisible, set its visibility to false.
}
// You can set more columns as needed
}
Because the RowCreated event (hidden) occurs during binding Data This column is bound to a column and hidden. Therefore, you can access the value of the Hidden Column.