Hi,
I think ListView Control is more appropriate in your case.You will be able
to implement your functionality easily with ListView Control.
The ListView property CheckedIndices will give you a collection of integers
representing the indexes of all the checked items in the ListView.
ListView.Checke dIndexCollectio n checkedItems =
listView1.Check edIndices;
while (checkedItems.C ount 0)
{
//your logic/code comes here
}
Also for selecting/Unselecting all items in ListView Control you just need
to provide one CheckBox above ListView Control and you can then run a loop in
its click event.
Although i have written chkSelectAllPMs _Click function in VB, you can easily
write same cose in C# or VB.NET with little modification.
Private Sub chkSelectAllPMs _Click()
If chkSelectAllPMs .Value Then
For i = 1 To ListView1.ListI tems.Count
ListView1.ListI tems(i).Checked = True
Next i
Else
For i = 1 To ListView1.ListI tems.Count
ListView1.ListI tems(i).Checked = False
Next i
End If
End Sub
You can search more about ListView Control in any search engine.
Hope this much helps you out.
Thanks and Regards,
Manish Bafna.
MCP and MCTS.
"Bret" wrote:
I am a VB Developer w/ SQL Server experience breaking into web world via the
Visual Web Developer Express. I've already set up my data sources to my SQL
Server tables and have created a grid view of my tables which executes
successfully. Two of the fields in the gridview are checkboxes that are
bound to a table, datatype is "bit". These 2 fields are "APPROVED" or
"DENIED", in other words, the user needs to check approve or deny a record.
My question is what is the right or best way to accomplish this task,
gridview doesn't seem to accomplish this the way I'd like. Since a user can
potentially have 100 records to approve, I dont want them to have to EDIT
each record one by one and then UPDATE, I just want them to be able to click
each checkbox.
Please help.
thank you.