Hi,
** The identifier will be the checkbox(checked & disable)
Nope, by identifier i mean the column which identifies your record uniquely in your database.
You need a correponding value inorder to identify which rows to be excluded.
I would suggest you to include the one more field (may be PK of the table) in your select statement.
Then you can have a invisible column in datagrid to store your unique record identifier.
Now,
'Declare an Array to hold IDs
dim UniqueIDList() as string
For i = 0 To DataGrid1.Items.Count - 1
item = DataGrid1.Items(i)
cb = CType(item.FindControl("cb"), CheckBox)
If cb.Checked = True And cb.Enabled = False Then
'Store the value of IDs to array
'Considering the Cells(0) has the IDs
'UniqueIDList(0) = item.Cells(0).Text
End If
Next
Then, Join the array and make a comma seperated string of IDs.
'Dim sID as string
'sID= UniqueIDList.Join(",")
Now, as you have the ID list, use it in DataView.filter.
Please check the syntax of the above code and modify, if needed. I need to switch too often in between VB.NET and C# for my work. So, most of the time i end up mixing the syntaxes of both
HTH