Visibiltiy option

2 posts, 0 answers
  1. Rahul Khinvasara
    Rahul Khinvasara avatar
    303 posts
    Member since:
    Aug 2007

    Posted 05 Dec 2007 Link to this post

       I am creating report where there is option of showing selected fields at runtime.
     In design mode I have designed all the fields. In run mode only those fields will be shown which is selected by the user.
        For that I am passing the parameter in report and at runtime making those  fields visible false which the user has not selected.
    Thus only those fields will be visible which the user wants to.
      Now  the problem is that the textbox which I want invisible occupies the place even though it is set to visible false. Thus lot of blank space is seen.
    Can you please help me how to make them visible false without occupying the space?


  2. Milen
    Milen avatar
    163 posts

    Posted 06 Dec 2007 Link to this post

    Hi Rahul Khinvasara,

    Thank you for contacting us again.

    Actually, the items with Visible property set to false does not occupy any space. I suppose you see columns of white space where the hidden items are, but that is because the rest of the items do not change their Width. And that is the expected behavior.

    If you want the visible items to span horizontally, you have to change their Size.Width and change their Location.X properties appropriately, after you hide the unwanted items.

    Other solution is to add the textboxes dynamically at runtime on the right location and with appropriate size, based on the user input, instead of create all the columns at design time and then hide them.

    If you have a report with Width reportWidth, and you have to display columnCount columns, then each column should look like reportWidth / columnCount  wide, and the Location.X of the textboxes should be

    ( reportWidth / columnCount ) * 0
    ( reportWidth / columnCount ) * 1
    ( reportWidth / columnCount ) * 2
    ( reportWidth / columnCount ) * (columnCount - 1)

    Please, have in mind to make the items a little bit narrower, so that they do not overlap.

    I hope this information helps. Do not hesitate to contact us if you need any further help.

    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. DevCraft banner
Back to Top