سؤال

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;
هل كانت مفيدة؟

المحلول

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;
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top