What I am trying to achieve is that I want the column to take up the remaining space by using Width="*" and the context I am using it is in RadTabControl.
Here is the code - comparing RadGridView outside DataTemplate, DataGrid, and RadGridView inside DataTemplate.
Here is the result -
RadGridView outside DataTemplate : The * works as expected and take up the remaining grid space.
DataGrid inside DataTemplate : The * works as expected and take up the remaining grid space.
RadGridView inside DataTemplate: The * is ignored and does not work. I have tried to use a specific number like 200 and it is ignored as well.
Is this a bug in how the Width is being handled?
Please assist.
Thanks,
Terry
<
telerikGrid:RadGridView
AutoGenerateColumns
=
"False"
Grid.Row
=
"3"
>
<
telerikGrid:RadGridView.Columns
>
<
telerikGrid:GridViewDataColumn
Header
=
"Name"
Width
=
"*"
/>
</
telerikGrid:RadGridView.Columns
>
</
telerikGrid:RadGridView
>
<
ListView
Grid.Row
=
"1"
ItemsSource
=
"{Binding Selections}"
>
<
ListView.ItemTemplate
>
<
DataTemplate
>
<
StackPanel
>
<
DataGrid
AutoGenerateColumns
=
"False"
>
<
DataGrid.Columns
>
<
DataGridTextColumn
Header
=
"name"
Width
=
"*"
/>
</
DataGrid.Columns
>
</
DataGrid
>
<
telerikGrid:RadGridView
AutoGenerateColumns
=
"False"
>
<
telerikGrid:RadGridView.Columns
>
<
telerikGrid:GridViewDataColumn
Header
=
"Name"
Width
=
"*"
/>
</
telerikGrid:RadGridView.Columns
>
</
telerikGrid:RadGridView
>
</
StackPanel
>
</
DataTemplate
>
</
ListView.ItemTemplate
>
</
ListView
>
12 Answers, 1 is accepted
Thank you for the feedback.
We will investigate the issue and we will contact you as soon as we have more information.
Best wishes,
Yordanka
the Telerik team
Please set ColumnWidth="*" for RadGridView to avoid this. Generally SizeToHeader will size the cells according to the column header and SizeToCells will size the cells according the cells content.
Kind regards,Vlad
the Telerik team
I have the same problem.
I don't want to use the ColumnWidth property of RadGridView. Because I want to set fixed width.
Are there another way?
And I can't find SizeToHeader and SizeToCells properties, how we can use them?
Please help me.
Thanks.
Hello
We have problem with the width columns.
When the view load there is jump in the grid columns.
After this the columns are arranged well.
is someone having a similar problem?
Best regards
Ehud
I have the same issue. A RadGridView inside of a DataTemplate ignores the individual Column Widths. This is important for me since the column text is supposed to wrap, and I cannot wrap the text if the column width is set to Auto.
I moved my RadGridView out of my DataTemplate, but I am not happy with this solution. Please fix it soon.
Indeed you are right, we are aware of this behavior. Still we meet some unexpected behavior of the Framework and we are not able to provide a permanent solution. It has been logged at our Public tracking system under PITS ID 4796, where you may follow its progress.
Didie
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
i have a similar problem. I am using the Q1 2011 Version. It seems that you can't set a "custom" header within a datatemplate.
Example:
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Path=BlockName}"
>
<
telerik:GridViewDataColumn.Header
>
<
StackPanel
>
<
TextBlock
Text
=
"Simulating a"
/>
<
TextBlock
Text
=
"MultiLine"
/>
</
StackPanel
>
</
telerik:GridViewDataColumn.Header
>
</
telerik:GridViewDataColumn
>
Within a DataTemplate you see the header "BlockName". This works without using a datatemplate. Is there a workarround for my version?
Thanks and Regards,
Thomas
The Header of the GridViewDataColumn is an object, it is not a DataTemplate. That is why you cannot set a "custom" header within a datatemplate.
Didie
the Telerik team
<
DataTemplate
x:Key
=
"MonthTemplate"
>
<
telerik:RadGridView
ItemsSource={Binding
Path
=
xxx
}>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Path=BlockName}"
>
<
telerik:GridViewDataColumn.Header
>
<
StackPanel
>
<
TextBlock
Text
=
"Simulating a"
/>
<
TextBlock
Text
=
"MultiLine"
/>
</
StackPanel
>
</
telerik:GridViewDataColumn.Header
>
</
telerik:GridViewDataColumn
>
...
Regards,
Thomas
As it turns out this is a very old issue (logged back in 2011).
If you have encountered a similar one and it is blocking for your work, then would it be possible for you to isolate it in a demo project and send it to us in a new support ticket? You can also take a look at this blog post for a reference on how to isolate an issue.
That way we will review the specific case and advice further.
Regards,
Dimitrina
the Telerik team