create column of datagrid
-
i have a datagrid that i want create the column of datagrid myself. i write this code but its not right in visual studio 2005 how can i do this work? BoundColumn dgColStord = new BoundColumn(); dgColStord.HeaderText = dsHeader.Tables[0].Rows[i]["stord_desc"].ToString(); dgColStord.DataField = i.ToString(); dgColStord.Columns.Add(dgColStord); the last line is not right it give error for columns.
-
i have a datagrid that i want create the column of datagrid myself. i write this code but its not right in visual studio 2005 how can i do this work? BoundColumn dgColStord = new BoundColumn(); dgColStord.HeaderText = dsHeader.Tables[0].Rows[i]["stord_desc"].ToString(); dgColStord.DataField = i.ToString(); dgColStord.Columns.Add(dgColStord); the last line is not right it give error for columns.
check that what is the value of i? coz i's value shd be the name of column in the datasource whose value will be set in the bound column why dont u try using a template column and sets the value in that columns coz bound column always requires a column name in the DataField here in ur code i seems to be an index
Regards, Rashida Jabeen http://www.akaas.net[^]