[RESOLVED] "Can not remove last non-fixed row"
I want to remove selecte row of MsFlexgid. I know the method to do that but suddenly I do not know what happens it gives me error as listed below:
"Can not remove last non-fixed row" .
It fires error in both conditions where row = 2 as well as row > 2.
1st method :
VB Code:
MSFlexGrid2.RemoveItem (MSFlexGrid1.Row)
2nd method :
VB Code:
Dim 1 as Intger
i = MSFlexGrid1.RowSel
MSFlexGrid2.RemoveItem i
Re: "Can not remove last non-fixed row"
If there is only one normal row left then you can't remove it using .RemoveItem, you'll have to use the .Rows property, something like:
VB Code:
If MSFlexGrid1.Rows - MSFlexGrid1.FixedRows = 1 Then
MSFlexGrid1.Rows = MSFlexGrid1.Rows - 1
End If
Re: "Can not remove last non-fixed row"
Thanx bushmobile :thumb: but I have changed it somthing like this :
VB Code:
[INDENT]If MSFlexGrid1.Rows - MSFlexGrid1.FixedRows = 1 Then
MSFlexGrid1.Rows = MSFlexGrid1.Rows - 1
Else
MSFlexGrid1.RemoveItem (MSFlexGrid1.RowSel)
End If[/INDENT]