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

[Solved] RadComboBox will not update

6 Answers 150 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
bigrich legend
Top achievements
Rank 1
bigrich legend asked on 26 Oct 2009, 09:38 AM
I have a radcombobox which is bound to an xml file for data. The combobox correctly reads this file and I am able to select items and retrieve data based on what is retrieved. The problem is that the text displayed in the drop down box does not update with the selected item. The text displayed is always the first item in the xml file even though the data retrieved is for the selected item. Any help on how to solve this is welcomed

6 Answers, 1 is accepted

Sort by
0
Vesko
Top achievements
Rank 2
answered on 26 Oct 2009, 01:49 PM
Make sure that each item has unique Value property.
0
bigrich legend
Top achievements
Rank 1
answered on 26 Oct 2009, 04:09 PM
Thanks for the reply.

Each item does have a unique value property. A snippet of the XML files is as follows:
<category>
  <Item Text="3D Objects" Value="/Galleries/sitegallery/*[@View='3DObjects']" image="3D Objects"  Selected="true" />
  <Item Text="Circle Packing" Value="/Galleries/sitegallery/*[@View='CirclePacking']" image="Circle Packing" />
  <Item Text="Knots" Value="/Galleries/sitegallery/*[@View='Knots']" image="Knots"  />
  <Item Text="Vector Art" Value="/Galleries/sitegallery/*[@View='VectorArt']" image="Vector Art" />
  <Item Text="Raytracing" Value="/Galleries/sitegallery/*[@View='Raytracing']" image="Raytracing"/>
  <Item Text="Iterated F. Systems" Value="/Galleries/sitegallery/*[@View='IFS']" image="Iterated F. Systems"  />
  <Item Text="2D Charts" Value="/Galleries/sitegallery/*[@View='2DCharts']" image="2D Charts" />  
</category>

0
Veselin Vasilev
Telerik team
answered on 29 Oct 2009, 10:19 AM
Hello bigrich legend,

I tried to bind the combo to this XML file and everything worked as expected:

<Items>
  <Item Text="3D Objects" Value="/Galleries/sitegallery/*[@View='3DObjects']" image="3D Objects"  Selected="true" />
  <Item Text="Circle Packing" Value="/Galleries/sitegallery/*[@View='CirclePacking']" image="Circle Packing" />
  <Item Text="Knots" Value="/Galleries/sitegallery/*[@View='Knots']" image="Knots"  />
  <Item Text="Vector Art" Value="/Galleries/sitegallery/*[@View='VectorArt']" image="Vector Art" />
  <Item Text="Raytracing" Value="/Galleries/sitegallery/*[@View='Raytracing']" image="Raytracing"/>
  <Item Text="Iterated F. Systems" Value="/Galleries/sitegallery/*[@View='IFS']" image="Iterated F. Systems"  />
  <Item Text="2D Charts" Value="/Galleries/sitegallery/*[@View='2DCharts']" image="2D Charts" />
</Items>

RadComboBox1.LoadContentFile("Combo.xml");


All the best,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
bradley baker
Top achievements
Rank 1
answered on 02 Nov 2009, 11:29 PM
I have the same issue.  Though Im bound to SQL.  It appears that it wont select the value if the values arent distinct.  I have my select so its in ASC order by mfgasgto team.  Every time I select "E - Engineered Products" the drop box will always go back and select "BB - BH @ BFD" which is the first in the list because it has the same DataValueField assigned to it.  Though if I use a normal ASP dropdown box it works properly.  The RadComboBox works just fine if I select one of the other options that has a distinct value assigned to it.

Doesnt Work
                        <telerik:RadComboBox ID="AsgTo" runat="server" DataSourceID="Asg2SQL"   
                            DataTextField="mfgasgto_team" DataValueField="mfgasgto_person">  
                        </telerik:RadComboBox> 
Works
                        <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="Asg2SQL"   
                            DataTextField="mfgasgto_team" DataValueField="mfgasgto_person">  
                        </asp:DropDownList> 

Database Fields
mfgasgto_id     mfgasgto_team                    mfgasgto_person
1                     BH - Blackhawk                    CORP\scott.butler
2                     C - Couplings                       CORP\p1
3                     E - Engineered Products     CORP\brad.baker
6                     O - SS Clamps                     CORP\p2
7                     S - Sleve Team                     CORP\p4
8                     W - Service Line                     CORP\brad.baker
9                     ST - Stations & Metersets     CORP\p10
10                   BB - BH @ BFD                     CORP\brad.baker
0
bigrich legend
Top achievements
Rank 1
answered on 04 Nov 2009, 07:38 AM
Hi there. What I did to solve the problem was change the property "EnableLoadOnDemand" to TRUE. It is false by default. Hope this helps.
0
bradley baker
Top achievements
Rank 1
answered on 04 Nov 2009, 11:15 PM
Thanks LoadonDemand resolved the issue or Q3 did.
Tags
ComboBox
Asked by
bigrich legend
Top achievements
Rank 1
Answers by
Vesko
Top achievements
Rank 2
bigrich legend
Top achievements
Rank 1
Veselin Vasilev
Telerik team
bradley baker
Top achievements
Rank 1
Share this question
or