This is a migrated thread and some comments may be shown as answers.

[Solved] Combobox with ItemTemplate (with no binding)

1 Answer 130 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Levi
Top achievements
Rank 1
Levi asked on 01 Apr 2009, 02:49 PM
Is it possible to have a combobox that drops down with custom content that doesn't bind to anything? I have two rows of option buttons that i need to show when dropping down the combo. I don't see how I could use binding to this as there would be two items side by side. I tried just putting the rows of combos in the itemtemplate but nothing shows up when expanding the combo. Is there a way to do this or perhaps a better method i should be using?

  <telerik:RadComboBox ID="RadComboBox2" Width="180px" Height="400px" AllowCustomText="true" Skin="Vista"
        EmptyMessage="Nada" runat="server">
        <ItemTemplate>
            <div style="width: 180px; height: 400px">
                <div style="width: 95px; float: left; line-height: 22px;">
                    <asp:RadioButton ID="rbtnToday" Text="Today" GroupName="DateFilter" runat="server"
                        AutoPostBack="false" CssClass="radioButton" Checked="true" /><br />
                    <asp:RadioButton ID="rbtnLast7Days" Text="Last 7 Days" GroupName="DateFilter" runat="server"
                        AutoPostBack="false" CssClass="radioButton" /><br />
                    <asp:RadioButton ID="rbtnThisMonth" Text="This Month" GroupName="DateFilter" runat="server"
                        AutoPostBack="false" CssClass="radioButton" /><br />
                    <asp:RadioButton ID="rbtnThisYear" Text="This Year" GroupName="DateFilter" runat="server"
                        AutoPostBack="false" CssClass="radioButton" /><br />
                </div>
                <div style="width: 85px; float: left; line-height: 22px;">
                    <asp:RadioButton ID="rbtnYesterday" Text="Yesterday" GroupName="DateFilter" runat="server"
                        AutoPostBack="false" CssClass="radioButton" /><br />
                    <asp:RadioButton ID="rbtnLast30Days" Text="Last 30 Days" GroupName="DateFilter" runat="server"
                        AutoPostBack="false" CssClass="radioButton" /><br />
                    <asp:RadioButton ID="rbtnLastMonth" Text="Last Month" GroupName="DateFilter" runat="server"
                        AutoPostBack="false" CssClass="radioButton" /><br />
                    <asp:RadioButton ID="rbtnAllTime" Text="All Time" GroupName="DateFilter" runat="server"
                        AutoPostBack="false" CssClass="radioButton" /><br />
                </div>
            </div>           
        </ItemTemplate>
    </telerik:RadComboBox>

1 Answer, 1 is accepted

Sort by
0
Levi
Top achievements
Rank 1
answered on 01 Apr 2009, 03:14 PM
Ok, i got the content to show up by adding an empty item:
  <Items>
            <telerik:RadComboBoxItem />
   </Items>


The problem is after selecting an option button, the combo box text changes to all of my option button texts combined into one long string. How do I prevent this? I only want the text to change to the selected item. Also it only closes when clicking on the text vs. the round button part of the option button.





Tags
ComboBox
Asked by
Levi
Top achievements
Rank 1
Answers by
Levi
Top achievements
Rank 1
Share this question
or