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

[Solved] Radcombobox selectedIndex

1 Answer 198 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Ayesha
Top achievements
Rank 1
Ayesha asked on 18 Nov 2009, 10:26 PM

Hi,

I've a radcombobox and I set the datasource to a  List<string>

 List<String> obDateItems   = GetDateForSelectedReports();

            m_radFromDateRangeCombo.DataSource  = obDateItems;
            m_radFromDateRangeCombo.DataBind();
            m_radFromDateRangeCombo.SelectedIndex = ???;

I need to set my selectedIndex to the last item in the combobox . how do I do this in c#?Pls help me with code.

Thanks,
ZR

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 19 Nov 2009, 07:52 AM
Hi Zaheka,

Have you tried following code in order to set the last item as selected?

 ....
m_radFromDateRangeCombo.DataBind();
m_radFromDateRangeCombo.SelectedIndex = m_radFromDateRangeCombo.Items.Count - 1;

-Shinu.
Tags
ComboBox
Asked by
Ayesha
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or