in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

SelectMode CheckBox Allow force click of box to check not row

Last post 04-18-2008 12:18 PM by mjk9564. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-16-2008 3:16 PM

    SelectMode CheckBox Allow force click of box to check not row

    Sorry if this is on the board already but I searched and couldn't find anything. Is there a way in the List to set the selectionmode to checkbox and then only allow the box to checked when the box is clicked. By default it allows the user to click anywhere in the row to check the box and for some things this is great but in my scenario I want to do a double-click event and this unchecks the box also.

  • 04-16-2008 5:11 PM In reply to

    Re: SelectMode CheckBox Allow force click of box to check not row

    Hello,
     
    You can try the given code snippet, which will allow the user to select
    a row, only when they click on the check box region.
     
    Private Sub C1List1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles C1List1.MouseClick

            Dim row, col As Integer

            Me.C1List1.CellContaining(e.X, e.Y, row, col)

            If col <> -1 Then

                    If Me.C1List1.SelectedIndices.Contains(row) Then

                           Me.C1List1.SetSelected(row, False)

                    Else

                           Me.C1List1.SetSelected(row, True)

                    End If

            End If

    End Sub

    Now you can also define your code in MouseDoubleClick event as well.
     
    I hope this will help.

    Regards,
    Allen Smith
    <mjk9564> wrote in message news:203957@10.0.1.98...

    Sorry if this is on the board already but I searched and couldn't find anything. Is there a way in the List to set the selectionmode to checkbox and then only allow the box to checked when the box is clicked. By default it allows the user to click anywhere in the row to check the box and for some things this is great but in my scenario I want to do a double-click event and this unchecks the box also.



    http://helpcentral.componentone.com/cs/forums/p/74983/203957.aspx#203957

  • 04-18-2008 12:18 PM In reply to

    Re: SelectMode CheckBox Allow force click of box to check not row

    That worked great! I was hoping for a property in the grid but I can work around this. This would be a great upgrade for the grid to have a property that this could be turned on or off. But, for now I will add it to my own control.

     

    Thanks! 

Page 1 of 1 (3 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.