Hi,
could you please help me with the following simple case: radcombobox in a repeater:
<asp:DataList ID="repeater" runat="server">
<ItemTemplate>
<span><%#DataBinder.Eval(Container.DataItem, "Label")%></span>
<telerik:RadComboBox runat="server" AutoPostBack="false" DataMember="<%#DataBinder.Eval(Container.DataItem, "Combo")%>" DataTextField="<%#DataBinder.Eval(Container.DataItem, "Text")%>"
DataValueField="<%#DataBinder.Eval(Container.DataItem, "Value")%>" OnDataBinding="comboBinding" />
</ItemTemplate>
</asp:repeater>
protected void comboBinding(Object sender, EventArgs e)
{
RadComboBox box = sender as RadComboBox;
box.DataSource = ds;
box.ID = string.Format("Filter_{0}", box.DataMember);
}
protected void Page_Load(object sender, EventArgs e)
if (! IsPostBack)
{
repeater.DataSource = dt;
repeater.DataBind();
}
else
{
// here I need to find out what was selected in all those combo boxes
}
I'd like to know the selected values of all combo boxes after PostBack but I can't find out how to do that. I set the IDs of the comboboxes to meaningful values but they probably don't exist yet in the PostBack as Page.FindControl("Filter_xx") didn't find them. How else can I obtain the combo boxes? Should I DataBind the repeater first? I have tried something like that but got an error. Please advise.
Thanks
could you please help me with the following simple case: radcombobox in a repeater:
<asp:DataList ID="repeater" runat="server">
<ItemTemplate>
<span><%#DataBinder.Eval(Container.DataItem, "Label")%></span>
<telerik:RadComboBox runat="server" AutoPostBack="false" DataMember="<%#DataBinder.Eval(Container.DataItem, "Combo")%>" DataTextField="<%#DataBinder.Eval(Container.DataItem, "Text")%>"
DataValueField="<%#DataBinder.Eval(Container.DataItem, "Value")%>" OnDataBinding="comboBinding" />
</ItemTemplate>
</asp:repeater>
protected void comboBinding(Object sender, EventArgs e)
{
RadComboBox box = sender as RadComboBox;
box.DataSource = ds;
box.ID = string.Format("Filter_{0}", box.DataMember);
}
protected void Page_Load(object sender, EventArgs e)
if (! IsPostBack)
{
repeater.DataSource = dt;
repeater.DataBind();
}
else
{
// here I need to find out what was selected in all those combo boxes
}
I'd like to know the selected values of all combo boxes after PostBack but I can't find out how to do that. I set the IDs of the comboboxes to meaningful values but they probably don't exist yet in the PostBack as Page.FindControl("Filter_xx") didn't find them. How else can I obtain the combo boxes? Should I DataBind the repeater first? I have tried something like that but got an error. Please advise.
Thanks