Hi..
I have the following ComboBox using a data template.. I'm trying to set the default value to a selection.
When the page loads the selection is blank.
I've tried
// BIND
var queryConf = from c in DC.conferences
orderby c.name descending
select c;
this.cmbConf.ItemsSource = queryConf.ToList();
// Set DEFAULT
this.cmbConf.SelectedItem = queryConf.ToList()[1];
this.cmbConf.Text = (queryConf.ToList()[1] as conference).name;
but the selection is still blank. !!!
I have also tried
this.cmbConf.SelectedIndex = 1;
How can I set the default value and show the values?
What am I doing wrong.
thx again
/// COMBOBOX
<telerikInput:RadComboBox TabIndex="6" Name="cmbConf" telerik:TextSearch.TextPath="name"
FontWeight="Bold" telerikControls:StyleManager.Theme="Vista"
SelectedValue="{Binding Path=id}" SelectedValuePath="id" Width="332" >
<telerikInput:RadComboBox.ItemTemplate>
<DataTemplate>
<Grid Margin="5" Width="300">
<Grid.ColumnDefinitions>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock FontWeight="Bold" FontSize="14" x:Name="txtConf" Text="{Binding name}" />
<TextBlock Foreground="Navy" Grid.ColumnSpan="3" Grid.Row="1" Text="{Binding name_alt}" />
<StackPanel Orientation="Horizontal" Grid.Row="2" Margin="0,0,0,0">
<TextBlock Foreground="Navy" Margin="5,0,0,0" Text="{Binding first_day, StringFormat=d}" />
<TextBlock Foreground="Navy" Margin="5,0,0,0" Text=" - " />
<TextBlock Foreground="Navy" Margin="5,0,0,0" Text="{Binding last_day, StringFormat=d}" />
</StackPanel>
</Grid>
</DataTemplate>
</telerikInput:RadComboBox.ItemTemplate>
</telerikInput:RadComboBox>
I have the following ComboBox using a data template.. I'm trying to set the default value to a selection.
When the page loads the selection is blank.
I've tried
// BIND
var queryConf = from c in DC.conferences
orderby c.name descending
select c;
this.cmbConf.ItemsSource = queryConf.ToList();
// Set DEFAULT
this.cmbConf.SelectedItem = queryConf.ToList()[1];
this.cmbConf.Text = (queryConf.ToList()[1] as conference).name;
but the selection is still blank. !!!
I have also tried
this.cmbConf.SelectedIndex = 1;
How can I set the default value and show the values?
What am I doing wrong.
thx again
/// COMBOBOX
<telerikInput:RadComboBox TabIndex="6" Name="cmbConf" telerik:TextSearch.TextPath="name"
FontWeight="Bold" telerikControls:StyleManager.Theme="Vista"
SelectedValue="{Binding Path=id}" SelectedValuePath="id" Width="332" >
<telerikInput:RadComboBox.ItemTemplate>
<DataTemplate>
<Grid Margin="5" Width="300">
<Grid.ColumnDefinitions>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock FontWeight="Bold" FontSize="14" x:Name="txtConf" Text="{Binding name}" />
<TextBlock Foreground="Navy" Grid.ColumnSpan="3" Grid.Row="1" Text="{Binding name_alt}" />
<StackPanel Orientation="Horizontal" Grid.Row="2" Margin="0,0,0,0">
<TextBlock Foreground="Navy" Margin="5,0,0,0" Text="{Binding first_day, StringFormat=d}" />
<TextBlock Foreground="Navy" Margin="5,0,0,0" Text=" - " />
<TextBlock Foreground="Navy" Margin="5,0,0,0" Text="{Binding last_day, StringFormat=d}" />
</StackPanel>
</Grid>
</DataTemplate>
</telerikInput:RadComboBox.ItemTemplate>
</telerikInput:RadComboBox>