[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 352
  • Last Modified:

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.
0
neutrinohunter
Asked:
neutrinohunter
  • 2
1 Solution
 
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:
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
 
jayeshshahCommented:
thanx for the 'B' grade .... :-(
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now