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

RadCombobox.SelectedValue

2 Answers 213 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Liji Jose
Top achievements
Rank 1
Liji Jose asked on 21 Apr 2010, 09:02 AM
Hi ,

            i am Popluating my radCombobox using databinding ,after populating it ,i want a sppecfic value to be shown as default value , so using
        RadComboBox.Selectedvalue = "Apple" ; 

But  using the Selectedvalue( ) Property i couldnt change the value . 

Thanks,
LijiJose
        

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 21 Apr 2010, 09:30 AM
Hi Liji Jose,

In which event, are you trying to set the SelectedValue? Give a try with DataBound event of RadComboBox and see whether it is working fine?

C#:
 
    protected void RadComboBox1_DataBound(object sender, EventArgs e) 
    { 
        RadComboBox1.SelectedValue = "Apple"
    } 


Thanks,
Princy.
0
Liji Jose
Top achievements
Rank 1
answered on 21 Apr 2010, 10:15 AM

Hi Princy ,

    In Item DataBound , its not working ..
    
            I have scenario like , my ComboBox is inside the FormView Control and I am Populating the Controls inside the FOrmview ,when a Row is Selected in the RadGridView .

I have used 

 

<

 

ClientSettings EnablePostBackOnRowClick ="true">

 

 

 

 in RadGrid , so that it postBack Occurs and When PostBack Occurs , in the Grid_ItemCommand Event i am Populating my ComboBox inside the FormView ,using A TypedDataset . 

m_Datatable = m_AdapterDomainCodes.GetData("FUND")

 

m_RadCmb.DataSource = m_Datatable

m_RadCmb.DataTextField =

"VALUE_CH"

 

 

 

m_RadCmb.DataValueField = "VALUE_CH"

 

 

 

m_RadCmb.DataBind()

 

 

m_RadCmb.SelectedValue = m_StrCmbFund

Thanks,

 

 

Tags
ComboBox
Asked by
Liji Jose
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Liji Jose
Top achievements
Rank 1
Share this question
or