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

Create GridView Columns at Runtime

1 Answer 81 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 14 Jan 2010, 04:38 PM

I'm witing to learn if it is possible to hide empty data columns in a Telerik Silverlight GridView.

I am working with a Silverlight-enabled WCF Service, and the SQL Select Statement is created at runtime, based on selected Check Box Felds on the Silverlight Client MainPage.xaml.

For example, a column exists with 10 fields (Check Boxes), and 3 fields are chosen.  When the GridView is displayed  on the .xaml page, there is data in the 3 chosen columns.  However, the other 7 empty data columns are displayed as well, and I am hoping hide the empty columns.

An alternative option is only send to the Silverlight client the data columns selected, rather than all 10 fields.  In this case, hiding empty columns columns would not be necessary.  However, so far I am unable to configure the List properly to accomplish this type of task.

Thanks in advance for any insight! Rob

1 Answer, 1 is accepted

Sort by
0
Accepted
Milan
Telerik team
answered on 18 Jan 2010, 11:30 AM
Hello Robert ,

The best approach for your case is to set MinWidth and Width to 0 (MinWidth should be set first) for all columns that should not be displayed.


Best wishes,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Robert
Top achievements
Rank 1
Answers by
Milan
Telerik team
Share this question
or