Is there a way to SPECIFY the width of EACH column in the flexgrid?
??
Printable View
Is there a way to SPECIFY the width of EACH column in the flexgrid?
??
use dis wicked code, aii
VB Code:
MSFlexGrid1.ColWidth(0) = 1000
Kick Ass.
Is that in Pixels, Twips, or what?
usually twips, but I fink it depends on da scalemode of da form, aii
Alright, Kickass.
Thanks.
What about pictures.
Can you put an ICON or IMAGE in a column?
progeix, your question did help me too. Thanks Ali etc...
Cool. That's always good.Quote:
Originally posted by CutePretty
progeix, your question did help me too. Thanks Ali etc...
Oh, ONE last question, That I have:
Is there a way to make it so you can *ONLY* select one row at a time. It allows you to select as many as you want, and I need it to select ONLY one row at a time.
Select column and row thnQuote:
Originally posted by progeix
What about pictures.
Can you put an ICON or IMAGE in a column?
Me.msflexgrid1.cellpicture=loadpicture() ' Put picture path or imagelist reference....
As far as selecting by column...
grid.AllowBigSelection = False
grid.SelectionMode = flexSelectionByColumn
grid.FocusRect = flexFocusNone
play with these. Selection Mode is the key, but check the other
settings to get the grid to look like you need.
-Enjoy
Ohhh... I'm sorry, I wasn't very clear.
I mean like, If you click a row, all the columns IN that row will light up.
BUT, If you SELECT a row, and drag the cursor down, you can select MULTIPLE rows..
I need it so, you can only select one whole row at a time...
If you need a picture, i'll be happy to produce one.
You can fake it by setting the select hilight color to the backcolor of the grid.
To my knowleddge there is not a way to stop multiple selecting...
You can force SELECTIONBYROW, but user can still highlight more than 1 row.
I just store the row on the ENTERCELL event, and set my column picture on that row...
Does this make sense?
grid.AllowBigSelection = False
grid.SelectionMode = flexSelectionByRow
Try that.
ah.
I left something out of that last one.
on the click event,
set grid.row = grid.rowsel
This will set the row to the last clicked row.
That's what I meant...:)Quote:
I just store the row on the ENTERCELL event
Salright? Salright.
I did that, and
"Wrong number of arguments or invalid property assignment"
Anyone know?
I don't know if you were responding to me or Mr. Stanich.
Basically we do the same thing.
He stores the value to a variable of the last row entered, and
I set the row highlight to the last selected row...
either or.
But, if you were talking to me, don't use the set with the grid.row.
the code would read
grid.row = grid.rowsel
like that, no set. my bad.
good luck.
It's still letting me select many rows =/Quote:
Originally posted by JPicasso
I don't know if you were responding to me or Mr. Stanich.
Basically we do the same thing.
He stores the value to a variable of the last row entered, and
I set the row highlight to the last selected row...
either or.
But, if you were talking to me, don't use the set with the grid.row.
the code would read
grid.row = grid.rowsel
like that, no set. my bad.
good luck.
As I said, and I've asked before, there is no known way to stop this... Fake it yes, but not stop it....Quote:
Originally posted by James Stanich
You can fake it by setting the select hilight color to the backcolor of the grid.
To my knowleddge there is not a way to stop multiple selecting...
You can force SELECTIONBYROW, but user can still highlight more than 1 row.
I just store the row on the ENTERCELL event, and set my column picture on that row...
Does this make sense?
Attached is how I do it...
Sorta done something
on the MOUSEMOVE event,
"List.Row = List.RowSel"
That works, except it only "selects" the first COLUMN in that row. anyway to get it to select all of the columns in that row?
SALRIGHT!
Private Sub List_SelChange()
List.Row = List.RowSel
List.ColSel = 2
End Sub
Works flawlessly.
you can SELECT all of the rows, but once you let go.. it only selects one
SHIFT+ARROW KEYS doesn't work either.
perhaps there is more code to drag only one selection over the rows.. i'll work on it
Cheers
yeh I played with this too. I selected the row and set my picture after the user stops playing...
You think MS would have offred this option...
James, thats one nice looking grid! Hey now!
---
progeix,
I guess I forgot something in the get-one-row-to-highlight code.
on the grid setup, I set:
grid.SelectionMode = flexSelectionByRow
grid.AllowBigSelection = False
grid.FocusRect = flexFocusNone
then in the click event...
grid.row = grid.rowsel
grid.col = 0
grid.colsel = grid.cols -1
I forgot about the columns. It's been a while since I wrote that.
The flex grid is a great tool, if you don't mind some manual coding.
I'm guessing some of the comercial controsl out there are better.
There outta be an easier way...
It's universal, but it leaves the Whistles and Bells alone. I use it extensively, and most of the time, have found it to suit most of the need.Quote:
The flex grid is a great tool, if you don't mind some manual coding.