|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Add header text dynamically in a datagrid with templatecolumns?Hello,
I have a dg, which uses templatecolumns. Now I would like to assing the header text of these columns, with the names I have in my dataset. But I dont get how to do that. Here is my dg: <asp:datagrid id="dg" ... AutoGenerateColumns="False"> <Columns> <asp:TemplateColumn> <ItemTemplate> <%#container.dataitem("somevalue")%> </ItemTemplate> </asp:TemplateColumn> </Columns> </asp:datagrid> thanks for any suggestion. Try
dg.Columns[index].HeaderText = HeaderName; HTH, Elton Wang elton_w***@hotmail.com Show quoteHide quote >-----Original Message----- >Hello, > > I have a dg, which uses templatecolumns. Now I would >like to assing the header text of these columns, with the >names I have in my dataset. But I dont get how to do that. >Here is my dg: > ><asp:datagrid id="dg" ... AutoGenerateColumns="False"> ><Columns> ><asp:TemplateColumn> > <ItemTemplate> > <%#container.dataitem("somevalue")%> > </ItemTemplate> ></asp:TemplateColumn> ></Columns> ></asp:datagrid> > >thanks for any suggestion. >. >
How to pass the selected row of a datagrid to another form
Datagrid Dropdownlist in default in edit mode "parent / child" datagrids CancelCommand Not Firing! Adding CSS to LinkButton JavaScript confirmation Set column names to template grid at runtime HyperLink column datagrid selection of fields in datatable for Datagrid Can we put ActiveX Control into the DataGrid Column? |
|||||||||||||||||||||||