What does actual databinding of datagrid occurs?

  • Thread starter Thread starter C.G. Oh
  • Start date Start date
C

C.G. Oh

I created datagrid with dynamically generated datacolumns and edit/delete
button columns.
Sometimes, I want to to hide first column from the database because it is a
primary key.

When I add the following code to any place in the source code, I realized
that it never gets to the following code:
this.DataGrid1.Columns[2].Visible = false;


*Columns[0] --> Edit button column
*Columns[1] --> Delete button column
*Columns[2]~Column[n] --> DataBound columns from database.

I know that Columns[2] supposes to have a primary key column. But when I
debug my code, I see that only columns[0] and columns[1] are available.

Can anyone tell me when the dynamic column binding actually happen and which
method to use?
 
Back
Top