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

[Solved] Declaring Values in Marcup Code

2 Answers 91 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Fabian
Top achievements
Rank 1
Fabian asked on 10 Jul 2009, 10:32 AM
Hello,

if I understand your Examples in the right way, there is no possibility to working with values in ComboboxItems, when  I declare them only in Marcup Code?

Why you make this change ???

I need to work with a declaration like this... now I need to fill all serverside.. to getting the selected value on serverside ...


 
  <telerik:RadComboBox ID="ddlColor"  Width="100px" Skin="Default" runat="server"
                            <Items> 
                                <telerik:RadComboBoxItem Value="" Text="Alle Farben" /> 
                                <telerik:RadComboBoxItem Value="1" Text="s/w" /> 
                                <telerik:RadComboBoxItem Value="0" Text="Farbe" /> 
                            </Items> 
                        </telerik:RadComboBox> 



Is there a Reason for this behavior???

Best regards

Fabian

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 10 Jul 2009, 11:44 AM
Hi Fabian,

I guess you want to access the selected item's value on server side. If so you can try the following code for that.
               String value = ddlColor.SelectedValue.ToString();

I tried the code in RadControls 2009.02.0701.20 version and found it is is working fine. Are you using different version of RadControls?

-Shinu.
0
Fabian
Top achievements
Rank 1
answered on 10 Jul 2009, 12:47 PM
I think I use the current Version, and if I try to access the Items serverside, only then Text is filled, the SelectedValue and all Values are empty. The SelectedItem is set but the Value there is empty too.

After fill the Dropdowns serverside, with LoadOnDemand True , over the ItemsRequested Event, all Values are set ..and accessable

Assembly Number 2009.1.521.20

Tags
ComboBox
Asked by
Fabian
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Fabian
Top achievements
Rank 1
Share this question
or