How are you?
I was wondering, is it possible to dymanically assign the value of a datagrid column's header text?
For example, I have a dropdown list, ddlone and the user selects an option from the list. How do I get ddlone.selecteditem.text to appear as a headertext in a bound column of a datagrid.
Here is the code for my datagrid:
<asp:datagrid id="dgEmps" runat="server" Width="617px" Height="190px" AutoGenerateColumns="False" BackColor="#eeeeee" HorizontalAlign="Center" Font-Bold="True" Font-Name="Verdana" Font-Size="10pt" HeaderStyle-VerticalAlign="Middle" footerstyle-verticalalign="Middle" HeaderStyle-HorizontalAlign="Center" footerstyle-horizontalalign="Center" HeaderStyle-BackColor="#7b87b2" HeaderStyle-height="100px" FooterStyle-height="200px" AlternatingItemStyle-BackColor="white" style="Z-INDEX: 107; LEFT: 176px; POSITION: absolute; TOP: 328px">
<Columns>
<asp:BoundColumn DataField="CPT_COMPETENCY_NM" HeaderText="Competency Name" />
<asp:BoundColumn DataField="EMPLOYEE ONE" HeaderText="XX" ItemStyle-HorizontalAlign="Center" />
<asp:BoundColumn datafield="EMPLOYEE TWO" HeaderText="XY" ItemStyle-HorizontalAlign="Center" />
</Columns>
</asp:datagrid>
I have been playing around with column controls and datagrid controls in
vb.net today and I dont see anything that is going to let me this.
thanks in advance,
Morris