This is a migrated thread and some comments may be shown as answers.

How to change listview checkbox toggle state to THREE state?

1 Answer 144 Views
CheckedListBox
This is a migrated thread and some comments may be shown as answers.
Vincent
Top achievements
Rank 1
Vincent asked on 17 Jan 2012, 05:12 AM
I set the ShowCheckBoxes property of a ListView to true. Now how can I change checkbox state to THREE state instead of two states. I know with a CheckBox you can set IsThreeState = true. I am not able to find this property of the ListView. 

thanks,
Kris...

1 Answer, 1 is accepted

Sort by
0
Ivan Todorov
Telerik team
answered on 17 Jan 2012, 02:51 PM
Hi Vincent,

Thank you for contacting us.

Currently, this feature is not supported by RadListView. However, as this sounds like a reasonable functionality, I have logged it to PITS as a feature request and we will implement it in a future release. Here is the link to the PITS item. For the time being, you can enable the ThreeState behavior of RadListView's items by adding a visual style to the indeterminate state of the items in the theme you are using and using the following code to apply it:
public Form1()
{
    InitializeComponent();
    ThemeResolutionService.LoadPackageFile(@"C:\CustomControlDefault.tssp");
    this.radListView1.ThemeName = "CustomControlDefault";
    this.radListView1.VisualItemCreating += new ListViewVisualItemCreatingEventHandler(radListView1_VisualItemCreating);
}
 
void radListView1_VisualItemCreating(object sender, Telerik.WinControls.UI.ListViewVisualItemCreatingEventArgs e)
{
    e.VisualItem.ToggleElement.IsThreeState = true;
}

I have attached the theme package used in the above snippet along with a screenshot which demonstrates how to add style to the indeterminate state.

Your Telerik points have been updated for your feature request.

I hope you find this useful.

Kind regards,
Ivan Todorov
the Telerik team

SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).

Tags
CheckedListBox
Asked by
Vincent
Top achievements
Rank 1
Answers by
Ivan Todorov
Telerik team
Share this question
or