We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

MultiSelect rows when RowHeadersVisible=false

I have found George Shepherd's Windows Forms FAQ for datagrids to be the most helpful in solving my datagrid problems. I hope someone can help me with a new datagrid problem. How do I mulitselect rows for a grid that has tablestyles.RowHeadersVisible=false? I have tried the following two approaches. 1) I tried the following (from George Shepherd's Windows Forms FAQ 5.8 example). This selected the new row selected, but this automatically unselected the previous row. FAQ 5.8 Private Sub dataGrid1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles dataGrid1.MouseUp Dim pt = New Point(e.X, e.Y) Dim hti As DataGrid.HitTestInfo = dataGrid1.HitTest(pt) If hti.Type = DataGrid.HitTestType.Cell Then dataGrid1.CurrentCell = New DataGridCell(hti.Row, hti.Column) dataGrid1.Select(hti.Row) End If End Sub 2) I have tried the VB sample Project from George Shepherd's Windows Forms FAQ 5.36 for the multiselect using the override of the OnMouseDown and OnCurrentCellChanged. This works great for the multiselect if RowHeadersVisible=true. Once RowHeadersVisible=False this no longer works. Please help! Thank you

3 Replies

JH Jody Harris May 9, 2003 03:08 AM UTC

I am having the exact same problem. Did anyone answer you on this question? If so what was the result? Please help ASAP > I have found George Shepherd's Windows Forms FAQ for datagrids to be the most helpful in solving my datagrid problems. > I hope someone can help me with a new datagrid problem. > > How do I mulitselect rows for a grid that has tablestyles.RowHeadersVisible=false? > > I have tried the following two approaches. > > 1) I tried the following (from George Shepherd's Windows Forms FAQ 5.8 example). > This selected the new row selected, but this automatically unselected the previous row. > > FAQ 5.8 > Private Sub dataGrid1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles dataGrid1.MouseUp > Dim pt = New Point(e.X, e.Y) > Dim hti As DataGrid.HitTestInfo = dataGrid1.HitTest(pt) > If hti.Type = DataGrid.HitTestType.Cell Then > dataGrid1.CurrentCell = New DataGridCell(hti.Row, hti.Column) > dataGrid1.Select(hti.Row) > End If > End Sub > > 2) I have tried the VB sample Project from George Shepherd's Windows Forms FAQ 5.36 for the multiselect using > the override of the OnMouseDown and OnCurrentCellChanged. > This works great for the multiselect if RowHeadersVisible=true. Once RowHeadersVisible=False this no longer works. > > Please help! > > Thank you >


JS John Smith September 3, 2003 05:32 AM UTC

Yes, I too am now having this problem. I know it was several months ago that this post was started, but there must be a solution to this!!!


JS John Smith September 3, 2003 09:30 AM UTC

To answer my own question, see the following posting: http://www.syncfusion.com/forums/message.asp?MessageID=6779

Loader.
Live Chat Icon For mobile
Up arrow icon