Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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

Here's what I'm up to.
Posted
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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...