How can you determine the height of a checkboxlist at runtime?

Discussion in 'ASP .Net Web Controls' started by szako, Jun 8, 2004.

  1. szako

    szako Guest

    I have a scenario where I need to position a submit button below a
    dynamically filled checkboxlist with an unknown number of records
    (check boxes). In order to pull this off (using absolute positioning),
    I need to be able to determine the height of the checkboxlist at
    runtime after I bind it to a dataset.

    When I check the Height.Value property of the checkboxlist web control
    at runtime it returns 0.0. I saw a post that says you have to set the
    initial height property first before you can retrieve a value, but
    doing that did not allow me to get the new height property after I
    loaded the checkboxlist with the dataset.

    Once I can determine the height of this control, I can add that value
    as part of an algorithm to determine where to place the submit button
    (below the checkboxlist).

    If anyone has any ideas or solutions, please post them as this has
    wasted WAY TOO MUCH of my time. :)

    Thanks,
    szako
     
    szako, Jun 8, 2004
    #1
    1. Advertising

  2. I don't have an answer for you, but I'm curious why you must use absolute
    positioning.

    It seems like if you added all the controls to a placeholder and let it
    flow, you'd have it done by now?

    "szako" <> wrote in message
    news:...
    >I have a scenario where I need to position a submit button below a
    > dynamically filled checkboxlist with an unknown number of records
    > (check boxes). In order to pull this off (using absolute positioning),
    > I need to be able to determine the height of the checkboxlist at
    > runtime after I bind it to a dataset.
    >
    > When I check the Height.Value property of the checkboxlist web control
    > at runtime it returns 0.0. I saw a post that says you have to set the
    > initial height property first before you can retrieve a value, but
    > doing that did not allow me to get the new height property after I
    > loaded the checkboxlist with the dataset.
    >
    > Once I can determine the height of this control, I can add that value
    > as part of an algorithm to determine where to place the submit button
    > (below the checkboxlist).
    >
    > If anyone has any ideas or solutions, please post them as this has
    > wasted WAY TOO MUCH of my time. :)
    >
    > Thanks,
    > szako
     
    Ken Cox [Microsoft MVP], Jun 8, 2004
    #2
    1. Advertising

  3. szako

    Shane Zako Guest

    I agree that if I had chosen a different pattern I would probably be
    done by now too. Unfortunately, this is the last piece that I haven't
    figured out yet and I'm already way down the road on this one. I don't
    know much about the placeholder control. I'll look into that for next
    time. The next page I develop like this I will use Flow layout and see
    which way is easier.


    *** Sent via Devdex http://www.devdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Shane Zako, Jun 8, 2004
    #3
  4. szako

    szako Guest

    I was never able to get the Height property of the Checkboxlist
    webcontrol to work properly. I had to finally just write an algorithm
    to determine the height of each row in the checkboxlist and then add
    up each row for the total height of the checkboxlist control. It
    works, it's just a pain that the documented property doesn't work like
    it's supposed too.

    Shane Zako <> wrote in message news:<#>...
    > I agree that if I had chosen a different pattern I would probably be
    > done by now too. Unfortunately, this is the last piece that I haven't
    > figured out yet and I'm already way down the road on this one. I don't
    > know much about the placeholder control. I'll look into that for next
    > time. The next page I develop like this I will use Flow layout and see
    > which way is easier.
    >
    >
    > *** Sent via Devdex http://www.devdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    szako, Jun 10, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JD
    Replies:
    5
    Views:
    11,791
    NetArchitect
    Aug 8, 2007
  2. Patrick.O.Ige
    Replies:
    5
    Views:
    19,246
    Patrick.O.Ige
    Jun 19, 2005
  3. Wotney
    Replies:
    1
    Views:
    544
    Flinky Wisty Pomm
    Oct 25, 2006
  4. Babu Mannaravalappil

    How to determine height of web panel control at runtime.

    Babu Mannaravalappil, May 24, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    192
    Babu Mannaravalappil
    May 24, 2004
  5. Replies:
    0
    Views:
    102
Loading...

Share This Page