RE: [flexcoders] datagrid height

2005-03-01 Thread Matt Chotin








http://livedocs.macromedia.com/flex/15/asdocs_en/mx/controls/listclasses/ScrollSelectList.html#rowCount
J











From: Robert
Brueckmann [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 01, 2005 9:44
AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] datagrid
height







Hey guysI am trying something and
getting a strange behavior. I get an array of objects from the database
that becomes the data provider for my datagrid. I know the length of my
data provider thanks to the myDataGrid.dataProvider.length method and I figure
I could multiply that number by some arbitrary number of pixels to ensure that
however many items are in my data provider, thats how many rows are
visible in my datagrid on the screenso the datagrid is never scrollable.



Im using a method that sets the
dataprovider of the datagrid, myDataGrid.dataProvider = data; and then
Im calling myDataGrid.setSize(Stage.width  35,
myDataGrid.dataProvider.length * 25); 



The Stage.width  35 compensatesfor
some other things on the screen to look proportionate and the
myDataGrid.dataProvider.length * 25 is just guesstimating that each row in the
datagrid component is about 25 pixels high. Well the first time I tried
this, 25 was too large of a number so I adjusted it to 22, which seemed to work
but still left me with a little extra bit of a final row visible. Well
that was livable. Then I get a result set back that only had 2 items in
it, instead of the 5 I had been testing this whole thing with and now only one
row was visble and you have to scroll down to see the second row, so I
increased the 22 to 30 and that fixed it for that but now if I call the
original result set with the 5 items, I can see a row and a half extra blank
rows. Is there a better way to dynamically show the number of rows based
on the number of items in the data provider? I wish there was a size
attribute like there is with the HTML select list component where if its
a list you can say I want x-number of rows visible. I just dont
ever want the user to have to scroll within the datagridis there an
easier way to do this?



Thanks! 

















This message contains information
fromMerlin Securities, LLC, or from one of its affiliates, that may be
confidential and privileged. If you are not an intended recipient, please
refrain from any disclosure, copying, distribution or use of this information
and note that such actions are prohibited. If you have received this
transmission in error, please notify the sender immediately by telephone orby
replying to this transmission.












Merlin Securities, LLC is a registered
broker-dealer. Services offered throughMerlin Securities, LLC are not
insured by the FDIC or any other Federal Government Agency, are not deposits of
or guaranteed byMerlin Securities, LLCand may lose value. Nothing
in this communication shall constitute a solicitation or recommendation to buy
or sell a particular security.













RE: [flexcoders] datagrid height

2005-03-01 Thread Robert Brueckmann







Thanks MattI really need to work on
my patience factor with searching the APIs. Sorrysuch an idiotI am.











From: Matt Chotin
[mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 01, 2005
10:55 AM
To: [EMAIL PROTECTED]
Subject: RE: [flexcoders] datagrid
height





http://livedocs.macromedia.com/flex/15/asdocs_en/mx/controls/listclasses/ScrollSelectList.html#rowCount
J











From: Robert
Brueckmann [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 01, 2005 9:44
AM
To: [EMAIL PROTECTED]
Subject: [flexcoders] datagrid
height







Hey guysI am trying something and
getting a strange behavior. I get an array of objects from the database
that becomes the data provider for my datagrid. I know the length of my
data provider thanks to the myDataGrid.dataProvider.length method and I figure
I could multiply that number by some arbitrary number of pixels to ensure that
however many items are in my data provider, thats how many rows are
visible in my datagrid on the screenso the datagrid is never scrollable.



Im using a method that sets thedataprovider
of the datagrid, myDataGrid.dataProvider = data; and then Im calling
myDataGrid.setSize(Stage.width  35, myDataGrid.dataProvider.length *
25); 



The Stage.width  35 compensatesfor
some other things on the screen to look proportionate and the
myDataGrid.dataProvider.length * 25 is just guesstimating that each row in the
datagrid component is about 25 pixels high. Well the first time I tried
this, 25 was too large of a number so I adjusted it to 22, which seemed to work
but still left me with a little extra bit of a final row visible. Well
that was livable. Then I get a result set back that only had 2 items in
it, instead of the 5 I had been testing this whole thing with and now only one
row was visble and you have to scroll down to see the second row, so I
increased the 22 to 30 and that fixed it for that but now if I call the
original result set with the 5 items, I can see a row and a half extra blank
rows. Is there a better way to dynamically show the number of rows based
on the number of items in the data provider? I wish there was a size
attribute like there is with the HTML select list component where if its
a list you can say I want x-number of rows visible. I just dont
ever want the user to have to scroll within the datagridis there an
easier way to do this?



Thanks! 

















This message contains information
fromMerlin Securities, LLC, or from one of its affiliates, that may be
confidential and privileged. If you are not an intended recipient, please
refrain from any disclosure, copying, distribution or use of this information
and note that such actions are prohibited. If you have received this
transmission in error, please notify the sender immediately by telephone orby
replying to this transmission.












Merlin Securities, LLC is a registered
broker-dealer. Services offered throughMerlin Securities, LLC are not
insured by the FDIC or any other Federal Government Agency, are not deposits of
or guaranteed byMerlin Securities, LLCand may lose value. Nothing
in this communication shall constitute a solicitation or recommendation to buy
or sell a particular security.
















This message contains information fromMerlin Securities, LLC, or from one of its affiliates, that may be confidential and privileged. If you are not an intended recipient, pleaserefrain from any disclosure, copying, distribution or use of this information and note that such actions are prohibited. If you have received this transmission in error, please notify the sender immediately by telephone or by replying to this transmission.


Merlin Securities, LLC is a registered broker-dealer. Services offered throughMerlin Securities, LLC are not insured by the FDIC or any other Federal Government Agency, are not deposits of or guaranteed byMerlin Securities, LLCand may lose value. Nothing in this communication shall constitute a solicitation or recommendation to buy or sell a particular security.