|
-
August 14th, 2012, 05:17 AM
#1
Sorting Data
Hi,
I have a form with a datagridview - on form load I have;
Code:
Dim irown As Integer
For irown = 0 To DgvPracExcl.Rows.Count - 1
DgvPracExcl.Rows(irown).Cells(0).ReadOnly = True
DgvPracExcl.Rows(irown).Cells(1).ReadOnly = True
DgvPracExcl.Rows(irown).Cells(2).ReadOnly = True
DgvPracExcl.Rows(irown).Cells(3).ReadOnly = True
DgvPracExcl.Rows(irown).Cells(4).ReadOnly = True
DgvPracExcl.Rows(irown).Cells(5).ReadOnly = True
Next irown
Therefore, I am forcing all cells to be ReadOnly.
Cells 0 - 3 : At the datagridview Behaviour - ReadOnly is set to TRUE, and sort mode Automatic.
Therefore, when I sort by either column the cells remain READONLY.
Now - for cell 4-5 : At the datagridview Behaviour - ReadOnly is set to FALSE, and sort mode Automatic.
Set to false, because the user can update this record.
The problem is for cell 4-5 at runtime, all columns are READONLY, but when I sort any column - the readonly (set at form load) is overwritten and you can type in data.
Why?
Thanks
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
|