How to change listview checkbox toggle state to THREE state?

2 posts, 0 answers
  1. Vincent
    Vincent avatar
    1 posts
    Member since:
    Dec 2011

    Posted 16 Jan 2012 Link to this post

    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. 

  2. Ivan Todorov
    Ivan Todorov avatar
    688 posts

    Posted 17 Jan 2012 Link to this post

    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()
        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).

Back to Top