bound data not displayed

5 posts, 0 answers
  1. dan
    dan avatar
    3 posts
    Member since:
    Feb 2011

    Posted 28 Feb 2011 Link to this post

    Hi, I am very new to telerik so please take it easy on me if you feel the answers to my questions are obvious.

    I'm using a ComboBox and when I select an item from the list of items the text is displayed but not the symbol 

    any help would be greatly appreciated 

    Dan

                

    <telerik:RadComboBox ID="RadComboBoxSymbols" runat="server" AutoPostBack="true" OnClientSelectedIndexChanged="OnSymbolChange"
                            OnSelectedIndexChanged="RadComboBoxSymbols_SelectedIndexChanged" Width="100">
                        </telerik:RadComboBox>
     
     
     
    private void BindToSymbolsList(Values.pointReg.PointRegistration pointRegistration)
            {
                RadComboBoxSymbols.Items.Clear();
                foreach (Symbol symbol in pointRegistration.Getallsymbols())
                {
                    RadComboBoxItem item = new RadComboBoxItem(symbol.Name,symbol.Id);
                    item.ImageUrl = symbol.Path;
                    RadComboBoxSymbols.Items.Add(item);   
                }
                RadComboBoxSymbols.SelectedIndex = 0;
            }
  2. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 02 Mar 2011 Link to this post

    Hi Dan,

    Where do you call the BindToSymbolsList method? Are the RadComboBox items properly displayed?

    Regards,
    Helen
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. dan
    dan avatar
    3 posts
    Member since:
    Feb 2011

    Posted 02 Mar 2011 Link to this post

    Hi thanks for your reply, here is a really small example of what I'm trying to do
    all I want is for the image to appear with the text when an item is selected

    public partial class _Default : System.Web.UI.Page
    {
      
        protected void Page_Load(object sender, EventArgs e)
        {
             
            
            RadComboBoxItem t = new RadComboBoxItem("text1","value1");
            t.ImageUrl = "./img/marker.png";
            RadComboBoxItem s = new RadComboBoxItem("text2", "value2");
            s.ImageUrl = "./img/marker-blue.png";
             
           RadComboBox1.Items.Add(t);
           RadComboBox1.Items.Add(s);
        }
     
        protected void RadComboBox1_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
        {
            
     
        }
     
    }


    http://mono.telerik.com/Combobox/Examples/Functionality/TextWithIcons/DefaultCS.aspx this link show a combobox that does the same as mine ................ no image shown when the text is displayed.

    any help would be great

    cheers
    dan
  4. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 02 Mar 2011 Link to this post

    Hello Dan,

    Probably you will find helpful the following code library project:

    http://www.telerik.com/community/code-library/aspnet-ajax/combobox/show-the-selected-item-image-in-input.aspx

    Regards,
    Helen
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  5. dan
    dan avatar
    3 posts
    Member since:
    Feb 2011

    Posted 03 Mar 2011 Link to this post

    Great thanks for that .................. works like a charm!!!

    cheers
    Daniel
Back to Top