1

I have a little problem with the library 'Telerik'. Indeed I want to implement a 'RadCombobox "with' checkBox '. It works well, yet when I want 'Check' an item, it is impossible?! Here is my sample code. I changed the property of the attribute 'selected' but that does not check the box 'checked' unfortunately .....

Thank you very much for your answer!

<!-- language: lang-cs -->

//Define the sqlAdaptater for binding source

System.Data.SqlClient.SqlDataAdapter myBinding = new SqlDataAdapter("SELECT [name] FROM [dbo].[tblProcess] WHERE [currentVersion] = 1 AND [deleted] = 0 AND [parent] = 0",connectionString);

DataTable links = new DataTable();

myBinding.Fill(links);

//Set the attributs of RadCombobBox

RadComboBoxSelectedEntity.DataTextField = "name";
RadComboBoxSelectedEntity.DataValueField = "name";
RadComboBoxSelectedEntity.DataSource = links;

//Not working..its selected but not checked ?
RadComboBoxSelectedEntity.SelectedIndex = 1;

//Not exist ?? -> 
RadComboBoxSelectedEntity.CheckedIndex = 1;
Mehdi Bugnard
  • 3,889
  • 4
  • 45
  • 86

1 Answers1

5

Try calling the method DataBind first

RadComboBoxSelectedEntity.DataBind();

After calling DataBind you could try this line of your code still not working,

RadComboBoxSelectedEntity.Items[1].Checked = true;
Claudio Redi
  • 67,454
  • 15
  • 130
  • 155
  • RadComboBoxSelectedEntity.Items[1].Checked -> does not exist in Telerik .. I have tested RadComboBoxSelectedEntity.DataBind(); after selectedIndex but not work .. :-( – Mehdi Bugnard Jun 22 '12 at 12:50
  • @Mehdi Bugnard: I'm surprised that `RadComboBoxSelectedEntity.Items[1].Checked` doesn't exist (they do on ASP.NET Ajax Controls). Which Telerik controls are you using? – Claudio Redi Jun 22 '12 at 13:03
  • Yes but it work only with DataTemplate ! – Mehdi Bugnard Jun 27 '12 at 14:17