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

[Solved] How to remove Extra Column

3 Answers 244 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Chris
Top achievements
Rank 1
Chris asked on 15 Sep 2010, 10:19 AM
Hi,

I am binding a RadGridView to a dynamic data source that can contain multiple numbers of columns. A blank column is always being displayed to the right of the grid and this column can not be selected. I am not adding this column in code and cannot see this column in the columns collection of the grid. How do I remove this column or prevent it from being generated in the first place?

Regards,
Chris

3 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 15 Sep 2010, 02:01 PM
Hello Chris,

Setting he ColumnWidth property of the RadGridView to "*"  will resolve the issue.

Best wishes,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Chris
Top achievements
Rank 1
answered on 15 Sep 2010, 02:31 PM
Hi Vanya,

Thanx for the reply. This has resolved the initial problem and the column has been removed. Following on from this, is there a way to prevent the extra column but not have the grid stretch to fill its container? The grid I have is contained within a ScrollViewer that sits within a RadTileViewItem. The behaviour I would like is that the columns in the grid extend to fit their cell contents, and if we only have say 2 columns of data to bind then this will potentially only stretch across half the available space. If 25 columns are returned the columns will again stretch to fully display their cell contents and the scrollviewer's horizontal scrollbar will be displayed.

Is this possible?

Regards,
Chris
0
Vanya Pavlova
Telerik team
answered on 15 Sep 2010, 04:00 PM
Hello Chris,

There are some issues that might occur when you place the GridView inside ScrollViewer.
When you add dynamically columns to the GridView and their count is 25 you even do not have to set the ColumnWidth to star if your HorizontalScrollBar is Enabled .
You also can set the Width property of your last colum ti "*" and the effect will be the same.
I have prepared an example for you that shows similar approach-several grids inside ScrollViewer.

Greetings,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Chris
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Chris
Top achievements
Rank 1
Share this question
or