Telerik Silverlight RadComboBox Selected Item
- by Chirag
i am customize telerik Datapager control in that control create one resource file and add one combobox for change page size of grid
<UserControl.Resources>
.......
<telerik:RadComboBox x:Name="CmbPageSize" MinWidth="40" telerik:StyleManager.Theme="{StaticResource Theme}" ItemsSource="{Binding Path=BindPageSize, Mode=TwoWay}" SelectedItem="{Binding Path=DataPagerPageSize_string, Mode=TwoWay}"></telerik:RadComboBox>
.......
Bind a combo with
public string DataPagerPageSize_string
{
get
{
if (_DataPagerPageSize_string == null || _DataPagerPageSize_string == string.Empty)
{
//DatapagerIndex = 1;
return DefaultPageSize.ToString();
}
return _DataPagerPageSize_string;
}
set
{
_DataPagerPageSize_string = value;
OnPropertyChanged("_DataPagerPageSize_string");
}
}
public List<string> BindPageSize
{
get
{
List<string> Pagerdata = new List<string>();
Pagerdata.Add("10");
Pagerdata.Add("20");
Pagerdata.Add("50");
Pagerdata.Add("100");
Pagerdata.Add("250");
Pagerdata.Add("500");
Pagerdata.Add("750");
Pagerdata.Add("1000");
Pagerdata.Add("1500");
Pagerdata.Add("2000");
Pagerdata.Add("Automatic");
Pagerdata.Add("All");
return Pagerdata;
}
}
this is working fine in case of if i select a value from combobox but i wan to change it from code behind Like
EVP.DataPagerPageSize_string = "All";
this thigs works fine but Combobox display me a old value;
if i will check a property then it show me a newly set value but combobox not select newly value