S
SamIAm
Hi
I have a DataGrid called dgTraders 1 of the columns is a template column and
this column has a Dropdown box in its HeaderTemplate section. The Dropdown
box is called selCities. How do I access this DropDown box at runtime?
<asp:datagrid id="dgTraders" runat="server" BorderColor="#DEDFDE"
BorderStyle="None" BorderWidth="1px" BackColor="White" CellPadding="4"
GridLines="Vertical" ForeColor="Black" AutoGenerateColumns="False"
Width="100%">
<SelectedItemStyle Font-Bold="True" ForeColor="White"
BackColor="#CE5D5A"></SelectedItemStyle>
<AlternatingItemStyle BackColor="White"></AlternatingItemStyle>
<ItemStyle BackColor="#F7F7DE"></ItemStyle>
<HeaderStyle Font-Bold="True" ForeColor="White"
BackColor="#6B696B"></HeaderStyle>
<FooterStyle BackColor="#CCCC99"></FooterStyle>
<Columns>
<asp:BoundColumn DataField="Firstname"
HeaderText="Firstname"></asp:BoundColumn>
<asp:BoundColumn DataField="Lastname"
HeaderText="Lastname"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="City">
<HeaderTemplate>
<aspropDownList id="selCities"
runat="server"></aspropDownList>
</HeaderTemplate>
<ItemTemplate>
<asp:Label id=Label1 runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.City") %>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id=TextBox1 runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.City") %>'>
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="CountryName"
HeaderText="Country"></asp:BoundColumn>
<asp:BoundColumn DataField="SubscriptionStatusName"
HeaderText="Subscription"></asp:BoundColumn>
<asp:ButtonColumn Text="Select"
CommandName="Select"></asp:ButtonColumn>
</Columns>
<PagerStyle HorizontalAlign="Right" ForeColor="Black"
BackColor="#F7F7DE" Mode="NumericPages"></PagerStyle>
</asp:datagrid>
I have a DataGrid called dgTraders 1 of the columns is a template column and
this column has a Dropdown box in its HeaderTemplate section. The Dropdown
box is called selCities. How do I access this DropDown box at runtime?
<asp:datagrid id="dgTraders" runat="server" BorderColor="#DEDFDE"
BorderStyle="None" BorderWidth="1px" BackColor="White" CellPadding="4"
GridLines="Vertical" ForeColor="Black" AutoGenerateColumns="False"
Width="100%">
<SelectedItemStyle Font-Bold="True" ForeColor="White"
BackColor="#CE5D5A"></SelectedItemStyle>
<AlternatingItemStyle BackColor="White"></AlternatingItemStyle>
<ItemStyle BackColor="#F7F7DE"></ItemStyle>
<HeaderStyle Font-Bold="True" ForeColor="White"
BackColor="#6B696B"></HeaderStyle>
<FooterStyle BackColor="#CCCC99"></FooterStyle>
<Columns>
<asp:BoundColumn DataField="Firstname"
HeaderText="Firstname"></asp:BoundColumn>
<asp:BoundColumn DataField="Lastname"
HeaderText="Lastname"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="City">
<HeaderTemplate>
<aspropDownList id="selCities"
runat="server"></aspropDownList>
</HeaderTemplate>
<ItemTemplate>
<asp:Label id=Label1 runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.City") %>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id=TextBox1 runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.City") %>'>
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="CountryName"
HeaderText="Country"></asp:BoundColumn>
<asp:BoundColumn DataField="SubscriptionStatusName"
HeaderText="Subscription"></asp:BoundColumn>
<asp:ButtonColumn Text="Select"
CommandName="Select"></asp:ButtonColumn>
</Columns>
<PagerStyle HorizontalAlign="Right" ForeColor="Black"
BackColor="#F7F7DE" Mode="NumericPages"></PagerStyle>
</asp:datagrid>