|
-
Mar 4th, 2004, 05:48 PM
#1
Thread Starter
Hyperactive Member
Programmatically Deselect Datagrid
I'm looking for a way to clear datagrid selections programmatically. For instance, if there are highlighted rows in a datagrid I want them to be cleared out (deselected, not highlighted) when the user presses a button thus forcing the user to make new selections. Any help is appreciated.
A cynic knows the price of everything but the value of nothing.
-
Mar 5th, 2004, 02:12 AM
#2
Fanatic Member
i think like listbox, setting row of the grid to -1 may solve the prob. not checked this stuff yet.
or
set the focus rectangle of the grid to none or light.
hope it helps...
-
Mar 5th, 2004, 04:16 PM
#3
Thread Starter
Hyperactive Member
That doesn't seem to work.
A cynic knows the price of everything but the value of nothing.
-
Mar 5th, 2004, 04:41 PM
#4
Sleep mode
This unselect specific row .
VB Code:
me.DataGrid1.UnSelect(row index)
-
Mar 5th, 2004, 04:43 PM
#5
Sleep mode
-
Mar 5th, 2004, 05:35 PM
#6
Thread Starter
Hyperactive Member
Thanks Pirate. Update didn't do anything but the Unselect method did. I have no idea how I missed that. Couldn't see the trees for the forest, I guess. I've got a loop going now:
Dim x As Int32
For x = 0 To DataGrid1.VisibleRowCount - 1
DataGrid1.UnSelect(x)
Next
however, just for grins, how do I do this with a For Each Loop?
A cynic knows the price of everything but the value of nothing.
-
Mar 6th, 2004, 02:57 AM
#7
Sleep mode
Update worked for me , though you can try this which repaint the grid .
For the foreach loop , no clue .
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
|