3 Answers, 1 is accepted
0
Hello John,
Thank you for contacting us.
Could you please send us your implementation of the ComboBox, are you using custom ItemTemplate? If you could reproduce this issue in a sample project and send it to us it will be very helpful for tracking down the source of the issue.
Looking forward to your reply.
All the best,
Konstantina
the Telerik team
Thank you for contacting us.
Could you please send us your implementation of the ComboBox, are you using custom ItemTemplate? If you could reproduce this issue in a sample project and send it to us it will be very helpful for tracking down the source of the issue.
Looking forward to your reply.
All the best,
Konstantina
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
John
Top achievements
Rank 1
answered on 02 Mar 2011, 11:53 PM
I am not using customTemplate. It is just a plain simple sample:
In my .cs file, I have:
When first run, the combobox will get the first index, and should show FULL in the display. However, it doesn't show anything.
Until, I add this line:
then it will show.
After binding the source, I want it select the first value, instead of the empty row.
Is there a way to force it to select the first index right away?
<
telerik:RadComboBox
HorizontalAlignment
=
"Left"
Margin
=
"132,48,0,0"
Name
=
"radComboBox1"
VerticalAlignment
=
"Top"
Width
=
"250"
/>
In my .cs file, I have:
public
partial
class
MainPage : UserControl
{
public
static
List<Quality> QualityList =
new
List<Quality>();
public
MainPage()
{
InitializeComponent();
QualityList.Add(
new
Quality() { qual_id = 1, qual_desc =
"FULL"
});
QualityList.Add(
new
Quality() { qual_id = 2, qual_desc =
"PARTIAL"
});
QualityList.Add(
new
Quality() { qual_id = 3, qual_desc =
"REQUIRED"
});
radComboBox1.SelectedValuePath =
"qual_id"
;
radComboBox1.DisplayMemberPath =
"qual_desc"
;
radComboBox1.ItemsSource = QualityList;
}
}
public
class
Quality
{
public
int
qual_id {
get
;
set
;}
public
string
qual_desc {
get
;
set
; }
}
When first run, the combobox will get the first index, and should show FULL in the display. However, it doesn't show anything.
Until, I add this line:
radComboBox1.SelectedIndex = 0;
After binding the source, I want it select the first value, instead of the empty row.
Is there a way to force it to select the first index right away?
0
Hello John,
Yes, to make it select the first index, you will have to set the SelectedIndex property, as you mentioned. By default the ComboBox doesn't select the first item. You can read more about the selection in ComboBox in this help article.
Please let us know if you have further questions.
All the best,
Konstantina
the Telerik team
Yes, to make it select the first index, you will have to set the SelectedIndex property, as you mentioned. By default the ComboBox doesn't select the first item. You can read more about the selection in ComboBox in this help article.
Please let us know if you have further questions.
All the best,
Konstantina
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!