|
-
Oct 25th, 2011, 09:48 AM
#1
Thread Starter
Lively Member
[RESOLVED] Datagridview column selecting
Is there a way to make a column unselectable? I can make the column read-only but it would be easier if it was unselectable so the user won't be confused trying to enter data into a read only cell. So if I clicked on a cell in that column or moved into that cell in that column it would jump to the next column, or not focus on the cell at all.
Thanks!
-
Oct 25th, 2011, 10:47 AM
#2
Lively Member
Re: Datagridview column selecting
Try clicking the smart tab on the DataGridView (looks like a 'Play' sideways triangle). In there are options to enable or disable Adding/Editing/Deleting, try disabling them and see if that is what you want ( I don't have access to VS right now.) There is also a property of the datagrid of 'ShowEditingIcon' I haven't really played around with it much but try disabling that as well.
-
Oct 25th, 2011, 10:55 AM
#3
Re: Datagridview column selecting
I know that if you click the smart tab, you can select edit columns. Under the behavor, change read only from false to true.
-
Oct 25th, 2011, 11:59 AM
#4
Re: Datagridview column selecting
This is one way,
Code:
Private Sub TagsdetailDataGridView_CellEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles TagsdetailDataGridView.CellEnter
If e.ColumnIndex = 2 Then
SendKeys.Send(Chr(Keys.Tab))
End If
End Sub
-
Oct 25th, 2011, 08:38 PM
#5
Thread Starter
Lively Member
Re: Datagridview column selecting
Thanks wes4dbt, works great!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|