5 Answers, 1 is accepted
0
Hi Alexander,
The scrollbars of the RadDataGrid are shown only when there is not enough space for the content. For example, if you have a single column with short text, the scrollbars will not be visible. When you have several columns with long text and if there is not enough space then some text or some columns have to be clipped - then the scrollbars are shown so you can be able to see all of the content.
With this being said, you shouldn't see scrollbars if all content is shown. If not all content is show, you want to have a scrollbar, otherwise the user will not be able to see all of the information.
Let me know if I was able to answer your question, or if I misunderstood the question.
Regards,
Petar Marchev
Progress Telerik
The scrollbars of the RadDataGrid are shown only when there is not enough space for the content. For example, if you have a single column with short text, the scrollbars will not be visible. When you have several columns with long text and if there is not enough space then some text or some columns have to be clipped - then the scrollbars are shown so you can be able to see all of the content.
With this being said, you shouldn't see scrollbars if all content is shown. If not all content is show, you want to have a scrollbar, otherwise the user will not be able to see all of the information.
Let me know if I was able to answer your question, or if I misunderstood the question.
Regards,
Petar Marchev
Progress Telerik
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 Feedback Portal
and vote to affect the priority of the items
0
Alexander
Top achievements
Rank 2
answered on 23 Jul 2018, 07:06 AM
Hi Petar,
thank you for your immediate response.
Let's say I have a grid which has all columns set to "Stretch=Fill" and an available horizontal space of 1000 Pixels (TextColumns-Only). I'd assume, if the grid requires more space that all text columns are wrapped - because I set FILL and not AUTO.
But that's not the case. I get the horizontal scrollbars though.
Am I missing something?
Thanks and kind regards,
Alexander
0
Hello Alexander,
Thank you for the clarification.
I understand what you expect but this is not how the sizing mode works. The presumption of the RadDataGrid is that the information is important and the datagrid will not clip it unless told to do so. This can only happen when the SizeMode of the column is Fixed.
When the SizeMode is Stretch, the datagrid will display the content fully and will not clip it. If the desired size of all columns is less than the available space then the leftover space will be distributed proportionally. This way, the columns get stretched. But if the desired size is more than the available space then the datagrid will use a scrollbar.
I think that in order for you to achieve the desired effect you can use the Fixed size mode and set the Width property of the column.
Let us know if you need more information.
Regards,
Petar Marchev
Progress Telerik
Thank you for the clarification.
I understand what you expect but this is not how the sizing mode works. The presumption of the RadDataGrid is that the information is important and the datagrid will not clip it unless told to do so. This can only happen when the SizeMode of the column is Fixed.
When the SizeMode is Stretch, the datagrid will display the content fully and will not clip it. If the desired size of all columns is less than the available space then the leftover space will be distributed proportionally. This way, the columns get stretched. But if the desired size is more than the available space then the datagrid will use a scrollbar.
I think that in order for you to achieve the desired effect you can use the Fixed size mode and set the Width property of the column.
Let us know if you need more information.
Regards,
Petar Marchev
Progress Telerik
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 Feedback Portal
and vote to affect the priority of the items
0
Rob
Top achievements
Rank 1
answered on 05 Dec 2018, 06:09 PM
I'm not the OP but I've just run into this issue too. There really should be an option for, at the very least, Text columns to choose Wrap behaviour in which case if it is set to Wrap/Clip then SizeMode=Stretch would only use available space and no horizontal scroll bar would be required. Allowing scrolling in both directions, while maybe occasionally necessary, is just not great design. SizeMode=Fixed isn't really a fix for this either as you can't know how much space you've got to work with if other columns are SizeMode=Auto. Even when I used a Template column I can't get the TextBlock wrapping behaviour I want because the column just keeps stretching forever.
0
Hi Rob,
Thank you for sending your feedback on this. I understand the current design may not be suitable in certain situations when you need to show more columns. Indeed, the sizing logic is implemented in such a way to show all the content (even with scrollbars) and I am afraid it will not be possible to change it at this point.
As you mentioned that clipping the columns content will also be appropriate, you could use the following workaround with TemplateColumn - wrap the content in Canvas like this:
I hope I was of help.
Regards,
Yana
Progress Telerik
Thank you for sending your feedback on this. I understand the current design may not be suitable in certain situations when you need to show more columns. Indeed, the sizing logic is implemented in such a way to show all the content (even with scrollbars) and I am afraid it will not be possible to change it at this point.
As you mentioned that clipping the columns content will also be appropriate, you could use the following workaround with TemplateColumn - wrap the content in Canvas like this:
<
grid:DataGridTemplateColumn
SizeMode
=
"Stretch"
CanUserResize
=
"False"
>
<
grid:DataGridTemplateColumn.CellContentTemplate
>
<
DataTemplate
>
<
Canvas
Width
=
"10"
Height
=
"30"
>
<
TextBlock
Text
=
"{Binding Description, Mode=TwoWay}"
/>
</
Canvas
>
</
DataTemplate
>
</
grid:DataGridTemplateColumn.CellContentTemplate
>
</
grid:DataGridTemplateColumn
>
I hope I was of help.
Regards,
Yana
Progress Telerik
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 Feedback Portal
and vote to affect the priority of the items