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

4 posts, 0 answers
  1. Dave
    Dave avatar
    11 posts
    Member since:
    Dec 2011

    Posted 05 Jul 2012 Link to this post

    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
  2. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 05 Jul 2012 Link to this post

    Hello,

    Please check below links.
    ComboBox / Multi-column ComboBox
    ComboBox / Custom Attributes
    Thanks,
    Jayesh Goyani
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dave
    Dave avatar
    11 posts
    Member since:
    Dec 2011

    Posted 05 Jul 2012 Link to this post

    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> 


  5. Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 10 Jul 2012 Link to this post

    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.
Back to Top