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

Do I need to create a new SQL table just to populate a drop down

3 Answers 33 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 05 Jul 2012, 05:33 PM
I am very new at this so, sorry if this is very basic.

I got a rad grid for all my employees and am trying to have a Race, Sex and Classification drop down box to populate the data.

Is there a way to do that right in the editor?

Do I just replace my bound fields with the dropdownboxes and enter the list of available choices somewhere? 

I can not seem to find a way to do this?

Thanks
Matt

3 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 05 Jul 2012, 05:46 PM
Hello,

Please check below links.
ComboBox / Multi-column ComboBox
ComboBox / Custom Attributes
Thanks,
Jayesh Goyani
0
Dave
Top achievements
Rank 1
answered on 05 Jul 2012, 08:57 PM
I got this piece from that, but I need something very basic.......

My datafield is emp_Sex and I need a drop down for Male and Female

Then I got another one for Race and another one for Classification

Teh code below looks way to confusing.

<telerik:RadComboBox ID="RadComboBox_AvatarSelection" 
                 runat="server"
                    Width="220px" 
                    HighlightTemplatedItems="True"
                    Skin="Black" 
                    CssClass="qsfexAlignedInput">
                    <ItemTemplate>
                     <!-- ImageClassName, Popularity and Artist are custom attributues of the items. 
                     You can add as many as you wish. -->
                        <div class="<%# DataBinder.Eval(Container, "Attributes['ImageClassName']") %>">
                            <span class="qsfexAvatarContainer"></span>
                            <span class="qsfexField">Popularity: <%# DataBinder.Eval(Container, "Attributes['Popularity']")%></span>
                            <span class="qsfexField">Artist: <%# DataBinder.Eval(Container, "Attributes['Artist']")%></span>
                        </div>
                    </ItemTemplate>                    
                    <Items>                     
                        <telerik:RadComboBoxItem
                            ImageClassName="qsfexGeeky"
                            Popularity="358"
                            Artist="Jone Larragne"
                            Text="Geeky">
                        </telerik:RadComboBoxItem>
                        
                        <telerik:RadComboBoxItem
                            ImageClassName="qsfexGirly"
                            Popularity="1,005"
                            Artist="Jone Larragne"
                            Text="Girly">
                        </telerik:RadComboBoxItem>
                        
                        <telerik:RadComboBoxItem
                            ImageClassName="qsfexGrumpy"
                            Popularity="1,345"
                            Artist="Jone Larragne"
                            Text="Grumpy">
                        </telerik:RadComboBoxItem>
                        
                        <telerik:RadComboBoxItem
                            ImageClassName="qsfexGroovie"
                            Popularity="2,043"
                            Artist="Jone Larragne"
                            Text="Groovie">
                        </telerik:RadComboBoxItem>
                    </Items>
                </telerik:RadComboBox> 


0
Eyup
Telerik team
answered on 10 Jul 2012, 06:54 AM
Hello Matt,

Could you please elaborate some more on the issue? Where exactly do you want to place the requested comboboxes:
 - in the edit form
 - or in the filtering item

Of course you could fill the combobox with your custom items without declaring additional SQL:
 - Design time:
<telerik:RadComboBox ID="RadComboBox1" runat="server">
      <Items>
          <telerik:RadComboBoxItem Text="Male" Value="m" />
          <telerik:RadComboBoxItem Text="Female" Value="f" />
      </Items>
</telerik:RadComboBox>
 - Code-behind:
RadComboBox RadComboBox1= new RadComboBox();
string
[] sexOptions = { "Male", "Female" };
RadComboBox1.DataSource = sexOptions;
RadComboBox1.DataBind();
  - Or:
RadComboBox comboBox = new RadComboBox();
RadComboBoxItem mItem = new RadComboBoxItem("Male", "m");
RadComboBoxItem fItem = new RadComboBoxItem("Female", "f");
comboBox.Items.Add(mItem);
comboBox.Items.Add(fItem);

If this is not you are looking for, please provide us additional detail as well as some screenshots of the desired behavior. Thus, we will be able to figure out what exactly you have in mind and suggest a proper approach.

Regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Dave
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Dave
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or