Hi,
I would like to know how to delete all the selected rows from an MSFlexGrid contol. What I have now will only delete the last selected row. Anyone know how to do this?
Thanks!
Printable View
Hi,
I would like to know how to delete all the selected rows from an MSFlexGrid contol. What I have now will only delete the last selected row. Anyone know how to do this?
Thanks!
So, what do you have so far?Quote:
Originally Posted by jseal
If the code is similar to a Listbox do the following.
Sorry I don't know anything about MSFlexGrid Control =\
VB Code:
Private Sub Command2_Click() Dim Inc As Integer ' or long For Inc = List1.ListCount - 1 To 0 Step -1 If List1.Selected = True Then List1.RemoveItem End If Next Inc End Sub
Then you shouldn't reply at all. Sorry.Quote:
Originally Posted by rack
VB Code:
Private Sub RemoveSelection() Dim i As Long, lStartSel As Long, lEndSel As Long With MSFlexGrid1 If .RowSel >= .Row Then 'its a Top -> Down selection lStartSel = .Row lEndSel = .RowSel Else 'its a Down -> Top selection lStartSel = .RowSel lEndSel = .Row End If For i = lEndSel To lStartSel Step -1 .RemoveItem i Next End With End Sub
Looks like I had the correct idea per post number 4. Just never used it before.Quote:
Originally Posted by RhinoBull
What is wrong with giving ideas and help? I am not telling him to draw pixels on the screen, or read from a file. I am telling him how to create the correct type of loop. The answer could be ignored, and at the very least, it could trigger a thought in the person who knows more about that type of control.
I would never post anything anti-productive. I felt it had relevance. I read a lot of posts that I do not post to, because I do not user that contorl, or understand a specific control.
Thanks jcis, it works great!
Nothing really. The problem however is that vast majority expects presise answers and idea of comparing Listbox with the FlexGrid may (and I'm sure will) create tons of confusion so best way would be not to reply if you aren't sure. Was your idea relevant? Besides the loop it really wasn't.Quote:
Originally Posted by rack
That's all.
Best regards. :wave:
I guess your right =) Sorry, Was in a bad mood yesterday from work, didn't mean to sound rude in my responce =).