I have a RadGrid (Telerik)[almost the same as a gridview] with a headertemplate and a itemtemplate:
<telerik:GridTemplateColumn DataField="field" SortExpression="field">
<HeaderTemplate>
<asp:Label Width="100%" Text="<center>Field</center>" runat="server" />
<asp:DropDownList runat="server" ID="ddlField" OnSelectedIndexChanged="ddlField_SelectedIndexChanged" AutoPostBack="true" Width="100%" />
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblField" runat="server" Text="testert" />
</ItemTemplate>
</telerik:GridTemplateColumn>
That same radgrid has also 2 other colums with the same templates and 1 column with a button. Now when the user chooses a value in the above shown dropdownlist, new items load in the other 2 itemtemplates. But when the user has choosen the values he wants, the user can press the button. When the user presses the button, the system should add a row with the values as labels. But i can’t find a way to get the values from the dropdownlists in the headertemplates when the onClick event of the button occurs. Can anyone tell me how I can access the selected values of the dropdownlists in the headertemplate from a OnClick event of a button?
P.S. I develop ASP.NET/C#!
Thanks in advance!!
Kind regards,
Wesley
Can you store the selected values from each dropdown into hidden form field and on button OnClick, access those hidden form fields? Form Viewstate should be enabled.