|
-
Feb 25th, 2006, 06:19 AM
#1
Thread Starter
Hyperactive Member
[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
Last edited by shirishdawane; Feb 25th, 2006 at 07:31 AM.
On Error GoTo http://www.vbforums.com
Note :
1) Please use [vbcode]your code goes in here [/vbcode] tags when posting VB code.
2) Please mark thread as Resolved using the Thread Tools menu, if you got solution.
-
Feb 25th, 2006, 07:56 AM
#2
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
-
Feb 25th, 2006, 08:16 AM
#3
Thread Starter
Hyperactive Member
Re: "Can not remove last non-fixed row"
Thanx bushmobile 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]
On Error GoTo http://www.vbforums.com
Note :
1) Please use [vbcode]your code goes in here [/vbcode] tags when posting VB code.
2) Please mark thread as Resolved using the Thread Tools menu, if you got solution.
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
|