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

bound data not displayed

4 Answers 51 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
dan
Top achievements
Rank 1
dan asked on 28 Feb 2011, 01:39 PM
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;
        }

4 Answers, 1 is accepted

Sort by
0
Helen
Telerik team
answered on 02 Mar 2011, 11:23 AM
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!
0
dan
Top achievements
Rank 1
answered on 02 Mar 2011, 03:29 PM
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
0
Helen
Telerik team
answered on 02 Mar 2011, 04:03 PM
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!
0
dan
Top achievements
Rank 1
answered on 03 Mar 2011, 09:01 AM
Great thanks for that .................. works like a charm!!!

cheers
Daniel
Tags
ComboBox
Asked by
dan
Top achievements
Rank 1
Answers by
Helen
Telerik team
dan
Top achievements
Rank 1
Share this question
or