This is a migrated thread and some comments may be shown as answers.

Visibiltiy option

1 Answer 132 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rahul Khinvasara
Top achievements
Rank 1
Rahul Khinvasara asked on 05 Dec 2007, 01:10 PM
Hi,
   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?

Thanks,
Rahul


1 Answer, 1 is accepted

Sort by
0
Milen
Telerik team
answered on 06 Dec 2007, 03:53 PM
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.

Milen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Rahul Khinvasara
Top achievements
Rank 1
Answers by
Milen
Telerik team
Share this question
or