Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
Can anyone help. I am having difficulty protecting just an individual cell on a data grid. Since it is column oriented, all I can seem to do is protect the entire colume. Thanks
  • Moderators
Posted

If this protection is based on the data contained in that cell, you can trap the selectedIndeChanged event, then determine its' contents then discard or disaloow changes at that point.

 

As far as I know you can't do this during render/bind.

Visit...Bassic Software
Posted

if you want to validate the data inside the column then the validation will apply to all the column,

else do the following,

use the yourdatagrid_MouseDown event, and write the following inside:

 

Dim hti As DataGrid.HitTestInfo = yourdatagrid.HitTest(e.X, e.Y)

 

If hti.Row <= yourdatagrid.DataSource.rows.count - 1 Then

If hti.Row = the_index_of_the_row_you_want Then

If hti.Type = Windows.Forms.DataGrid.HitTestType.Cell Then

If hti.Column = your_column Then

msbBox("You can't access");

End If

End If

End If

End If

 

Mohsen

Posted

Actually the protection is based on the data contained in the previous cell as to whether or not they have access to the next cell or not. Depending upon the actual type of information entered into the previous cell, I then need to determine whether or not to gray out and protect the following cell. I will try the ideas that you have given me so far. If you have a better solution based on this additional information, please let me know.

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...