smriti Posted July 8, 2005 Posted July 8, 2005 Dear friends, I want to disable two of my columns of windows forms datagrid. I am already using tablestyles and making the readonly property of both the columns to false. But on clicking the cell with mouse the cell is highlighting. How to prevent this. please helpl me. Thanks Quote
Machaira Posted July 8, 2005 Posted July 8, 2005 You should be able to adapt this: Private Sub DataGrid1_CurrentCellChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.CurrentCellChanged If Me.DataGrid1.CurrentCell.ColumnNumber = 0 Then Me.DataGrid1.CurrentCell = New DataGridCell(Me.DataGrid1.CurrentRowIndex, 1) End If End Sub Quote Here's what I'm up to.
smriti Posted July 9, 2005 Author Posted July 9, 2005 You should be able to adapt this: Private Sub DataGrid1_CurrentCellChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.CurrentCellChanged If Me.DataGrid1.CurrentCell.ColumnNumber = 0 Then Me.DataGrid1.CurrentCell = New DataGridCell(Me.DataGrid1.CurrentRowIndex, 1) End If End Sub Thanks a lot. It did most of my work. but now i don't want to set focus on any column how to do this. Thanks. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.