MsFlexGrid Delete Last Row

Two quick and possible easy questions,

I can't delete the last row of my msflexgrid
It says Can not delete the last non-fixed row
Run time error 30015

here is my code

Private Sub Delete_click()
tablegrid.RemoveItem (tablegrid.Rowsel)

Secondly
How can i make it where multiple rows are selected they will all be deleted.
neutrinohunterAsked:
Who is Participating?
 
jayeshshahCommented:
try this code below for deleting the 1st row.

If MSFlexGrid1.Rows = 0 Then Exit Sub
    If (MSFlexGrid1.Rows - MSFlexGrid1.FixedRows) <= 1 Then
        MSFlexGrid1.Rows = MSFlexGrid1.Rows - 1
    Else
        MSFlexGrid1.RemoveItem MSFlexGrid1.RowSel
    End If


 Regards

JBS
0
 
SethiCommented:
There should be minimum one row in a flexgrid at any point of time and this is its inbuilt design. You will have to ensure error handlers in your code for this error if you provide row deletion functionality in your code.
0
 
jayeshshahCommented:
thanx for the 'B' grade .... :-(
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.