For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > September 2006 > MsFlexGrid.clear??









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author MsFlexGrid.clear??
Steve

2005-07-24, 8:19 pm

Hi again...

You guys helped me out before with a super-simple solution... maybe there's
another simple answer out there??

I used row=0 to lay headers into msflexgrid. Seems .clear wipes the ENTIRE
grid... is there a single command that would clear the grid starting with
row 1 (or 2)??

Right now I ran .clear and re-entered the headers but seems so sloppy. I'm
staying away from looping cause that's even more sloppy (to me that is)

Thanks again
Steve


Rick Rothstein

2005-07-24, 8:19 pm

> You guys helped me out before with a super-simple solution... maybe
there's
> another simple answer out there??
>
> I used row=0 to lay headers into msflexgrid. Seems .clear wipes the

ENTIRE
> grid... is there a single command that would clear the grid starting

with
> row 1 (or 2)??
>
> Right now I ran .clear and re-entered the headers but seems so sloppy.

I'm
> staying away from looping cause that's even more sloppy (to me that

is)

A single command? No. But you could do this...

With MSFlexGrid1
.Row = .FixedRows
.Col = 0
.RowSel = .Rows - 1
.ColSel = .Cols - 1
.FillStyle = flexFillRepeat
.Text = ""
.Col = 1
End With

where you may have to reset the FillStyle if leaving it in repeat mode
is a problem. The above code clears everything below the header row or
rows (you could have more than one fixed row that you want to leave
intact). If you only want to clear the data in the grid, but not the
fixed row(s) or column(s), then use this code...

With MSFlexGrid1
.Row = .FixedRows
.Col = .FixedCols
.RowSel = .Rows - 1
.ColSel = .Cols - 1
.FillStyle = flexFillRepeat
.Text = ""
.Col = 1
End With

Rick


Bob Butler

2005-07-24, 8:19 pm

"Rick Rothstein" <rickNOSPAMnews@NOSPAMcomcast.net> wrote in message
news:uTobYNGkFHA.3148@TK2MSFTNGP09.phx.gbl
>
> A single command? No. But you could do this...
>
> With MSFlexGrid1
> .Row = .FixedRows
> .Col = 0
> .RowSel = .Rows - 1
> .ColSel = .Cols - 1
> .FillStyle = flexFillRepeat
> .Text = ""
> .Col = 1
> End With
>
> where you may have to reset the FillStyle if leaving it in repeat mode
> is a problem. The above code clears everything below the header row or
> rows (you could have more than one fixed row that you want to leave
> intact). If you only want to clear the data in the grid, but not the
> fixed row(s) or column(s), then use this code...
>
> With MSFlexGrid1
> .Row = .FixedRows
> .Col = .FixedCols
> .RowSel = .Rows - 1
> .ColSel = .Cols - 1
> .FillStyle = flexFillRepeat
> .Text = ""
> .Col = 1
> End With


assuming you have no fixed columns this may be simpler:
Dim r As Long
With MSFlexGrid1
r = .Rows
.Rows = .FixedRows
.Rows = r
End With

--
Reply to the group so all can participate
VB.Net: "Fool me once..."

Rick Rothstein

2005-07-24, 8:19 pm

> assuming you have no fixed columns this may be simpler:
> Dim r As Long
> With MSFlexGrid1
> r = .Rows
> .Rows = .FixedRows
> .Rows = r
> End With


Good point! (I keep forgetting how useful "collapsing" the grid can be.)

Rick


Steve

2005-07-24, 8:19 pm

Well now... I really am impressed with this group... not only fast/accurate
responses but both of these fixes are really SLICK... borderline devious...
hehe

THANKS AGAIN!! And... also I really really appreciate that NO ONE has made
any fun/flames of my less-than-average-VB6-expertise.

Steve


"Rick Rothstein" <rickNOSPAMnews@NOSPAMcomcast.net> wrote in message
news:edTFdhGkFHA.2916@TK2MSFTNGP14.phx.gbl...
>
> Good point! (I keep forgetting how useful "collapsing" the grid can be.)
>
> Rick
>
>



nitinnkn

2006-09-04, 1:57 pm

quote:
Originally posted by Steve
Well now... I really am impressed with this group... not only fast/accurate
responses but both of these fixes are really SLICK... borderline devious...
hehe

THANKS AGAIN!! And... also I really really appreciate that NO ONE has made
any fun/flames of my less-than-average-VB6-expertise.

Steve


"Rick Rothstein" <rickNOSPAMnews@NOSPAMcomcast.net> wrote in message
news:edTFdhGkFHA.2916@TK2MSFTNGP14.phx.gbl...
>
> Good point! (I keep forgetting how useful "collapsing" the grid can be.)
>
> Rick
>
>



This whole thing is very fine !

"The glass is half filled or the glass is half empty means the same thing"

Similarly instead of clearing all the rows below we clear the complete grid and redraw the first one again............."

Well see will this helps
'****************************
With grd_disp
.Clear
.AllowUserResizing = flexResizeBoth
.RowSizingMode = flexRowSizeAll
.FixedCols = 0
.FixedRows = 0
.ColHeader(0) = flexColHeaderOn
.ColHeaderCaption(0, 0) = "Name"
.ColHeaderCaption(0, 1) = "Policy No."
.ColHeaderCaption(0, 2) = "Mode"
.ColHeaderCaption(0, 3) = "Premium"
.ColHeaderCaption(0, 4) = "Due Date"
.ColHeaderCaption(0, 5) = "Payment Date"
.ColHeaderCaption(0, 6) = "Mobile No."
.ColWidth(0, 0) = 2500
.ColWidth(1, 0) = 1000
.ColWidth(2, 0) = 1000
.ColWidth(3, 0) = 1000
.ColWidth(4, 0) = 1500
.ColWidth(5, 0) = 1500
.ColWidth(6, 0) = 1500
End With
'****************************
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com