FlexGrid Longer
Hi,
I like to have just one column but longer cell which property should I edit to make the cell longer. I am new at VB, any help is always good.
# 1 Re: FlexGrid Longer
Property Cols for number of cols (count starting by 1)
Property .ColWidth(index) (index starting by 0)
Const thelength As Integer = 2000
Private Sub Form_Load()
With MSFlexGrid1
.FixedCols = 0
.Cols = 1
.ColWidth(0) = thelength
End With
End Sub
# 2 Re: FlexGrid Longer
Hi, thanks alot..
If I have a 1 column and like 10 rows the code you posted will it work with my modification i made on the code below.
Const thelength As Integer = 2000
Private Sub Form_Load()
dim i as integer
for i = 0 to eof(1)
With MSFlexGrid1
.FixedCols = 0
.Cols = 0
.Rows = i
.ColWidth(0) = thelength
End With
End Sub
# 3 Re: FlexGrid Longer
?
for i = 0 to eof(1)
You need 10 rows?
Have a look at attached sample
# 4 Re: FlexGrid Longer
Hi Cimperiali, thanks for the code it sure help a lot. Is there anyway to modify your code, because let say I have 5 data files to read to the flexgrid. And each data files have different amount of records. so on the previous posted message I mention about the for loop to eof() statement and while the records it is not eof() it will continue to read the records and add flexgrid automatically to display the records contents until eof(). Is this possible?
# 5 Re: FlexGrid Longer
Yes. See you after my holidays (less than a week), if no one
answer faster...
;)
# 6 Re: FlexGrid Longer
Hey thanks alot, I'll see you sometime next week for more help if you don't mind. Much appreicated it.
# 7 Re: FlexGrid Longer
How can you store a click event on msflexgrid1.selectionmode to a string variable so I can perform the left$() function. thanks
# 8 Re: FlexGrid Longer
To answer your first question:
There are two ways of increasing the number of rows eg for the five different files:
The first being to
Set the .ROWS property on the grid to a large number eg 9999.
keep a counter, and increment it every time you add something to the grid.
When you have finished looping through the files, set the .ROWS value of the grid to the value in your counter, if you have any fixed rows you will need to take them into account.
The second way,
is to use the .ADDITEM function. If a row doesn't exist, it will cause an error which you can trap in your error handling routine - I don't remeber the error number, but you could find it easy enough.
HTH
# 9 Re: FlexGrid Longer
Forgot to say earlier, if you make your grid invisible, load it and then visible again, it works alot faster than keeping the grid visible.
In relation to the .SELECTIONMODE, according to the help this only works for the Hierarchial Grid, not the ordinary one.
What are you trying to do?
# 10 Re: FlexGrid Longer
To set up a working example for you, I need a sample file of data you're going to use (or at least, need to know if data in files are
separated by Chr 10, Vbcrlf, commas or whatever).
Post a reply here adding a zipped data file of the kind you're
going to use.
# 11 Re: FlexGrid Longer
hi Cimperiali
and welcome back, I am still on nightmare and so stressout with this flexgrid. I hope you could help me out thanks.
# 12 Re: FlexGrid Longer
A bit busy now. Will post something tomorrow.
Btw, from zip Form 2 is not included...
# 13 Re: FlexGrid Longer
thanks, glad just to hear your helping me. I wonder why the form2 did not save byself when I saved the project. but I resaved the form2 by itself.
# 14 Re: FlexGrid Longer
Your task is not completely clear.
I did some changes to your project. See if this can help you
# 15 Re: FlexGrid Longer
hi Cimperiali,
how was your weekend doing? I will check the code tomorrow if that is okay, cuz right now I am working on my c++ selfstudy project. I'll give you a help call if that is okay with you, thanks for all the help. much appreciated it.
# 16 Re: FlexGrid Longer
Hi Cimperiali,
I checked your code, it is much clean and clear well coded I say it make my head hurt. I am doing the form2 I did code is sorta semi working I was wondering if you have spare time could you recheck it and help me out thanks.