You must Sign In to post a response.
  • Category: Windows

    ListView1 with checkboxes is true, when i clicked on items......... urgent

    i have listView1 and i made checkboxes is true,

    have added some items to listview,

    when i run application, if user clicks on any list items it should get checked and if user clicks same again it should get unchecked


    how to do this
  • #762203
    Hi Ashok,

    I'm little bit confused, after read your thread..?

    Default nature of checkbox is select/ deselect. You are asking the default behavior of that control, no need to write any code for the same.

    If you are expecting something different, please let me know.

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #762206
    Hi

    The checkbox property by default is checked when clicked once and gets unchecked when clicked again.

    What exactly your requirement is? Have you made the checkbox checked to true in your code and now want to remove that?

    Please share the code in which event you have written the code, so that any one can give solution.

    Regards

    Sridhar Thota.

    Sridhar Thota.
    Editor: DNS Forum.

  • #762212
    Hello Ashok,

    As per my understanding i have done it.

    Add ListView to your form :

    Add some items to your list view :

    private void Form1_Load(object sender, EventArgs e)
    {
    listView1.Items.Add("Paper", 1);
    listView1.Items.Add("Pencil", 2);
    listView1.Items.Add("Eraser", 3);
    listView1.Items.Add("Pen", 4);
    listView1.Items.Add("Notes", 5);
    }

    change your checkboxes property of Listview to true.

    Double click on your items. If it is unchecked then it will be checked. If it checked then it will be unchecked.

    See the attached image. It's an output i have got using above mentioned code.

    Regards,
    Nirav Lalan
    DNS Gold Member
    "Failure is the path of least persistence"

    Delete Attachment


Sign In to post your comments