Hi,
I'm having difficulty resizing my RadGridView (within a UserControl) to fit within the bounds of the window. My RGV consists of several fixed columns and a few other columns that I'd like to be each a set fraction of the remaining width available. Using the help given in this post, this is my current xaml (simplified):
Currently when the RGV is filled the columns expand past the edge of the window. I'd like them to fit to the window.
Because this is likely related to fitting the RGV to the window, here are further details about the columns:
Columns ColSubject, ColNotes, and ColAssignedToFullAbbr are the variable width columns, with ColNotes taking up the most space, followed by ColSubject, then ColAssignedToFullAbbr. I'm not sure whether functionality exists for this, but I've also put minimum widths for the other columns so that should the variable width columns require more space, space up to a certain amount can be given to them from the other columns. Finally, should the variable width columns still require more space, I'd like the text to wrap, hence I've added TextWrapping="Wrap".
If it matters, I've tried setting a fixed size to the window containing this UserControl, and a similar result occurs.
Any help is appreciated.
I'm having difficulty resizing my RadGridView (within a UserControl) to fit within the bounds of the window. My RGV consists of several fixed columns and a few other columns that I'd like to be each a set fraction of the remaining width available. Using the help given in this post, this is my current xaml (simplified):
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"*"
/>
</
Grid.RowDefinitions
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"*"
/>
</
Grid.ColumnDefinitions
>
<
telerik:RadGridView
ItemsSource
=
"{Binding Source={StaticResource MainRepo}, Path=DvFocusControl}"
Name
=
"rgvGrid"
AutoGenerateColumns
=
"False"
RowLoaded
=
"rgvGrid_RowLoaded"
ShowGroupPanel
=
"False"
MouseDoubleClick
=
"rgvGrid_MouseDoubleClick"
Grid.Row
=
"0"
Grid.Column
=
"0"
Grid.ColumnSpan
=
"1"
Grid.RowSpan
=
"1"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
ScrollViewer.HorizontalScrollBarVisibility
=
"Disabled"
EnableColumnVirtualization
=
"False"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
Name
=
"ColAutoNum"
Header
=
"#"
IsReadOnly
=
"True"
MinWidth
=
"50"
Width
=
"50"
/>
<
telerik:GridViewDataColumn
Name
=
"ColType"
Header
=
"Type"
IsReadOnly
=
"True"
MinWidth
=
"30"
Width
=
"50"
/>
<
telerik:GridViewDataColumn
Name
=
"ColRequest"
Header
=
"Request"
IsReadOnly
=
"True"
MinWidth
=
"80"
Width
=
"80"
/>
<
telerik:GridViewDataColumn
Name
=
"ColSubject"
DataMemberBinding
=
"{Binding Subject}"
Header
=
"Subject"
IsReadOnly
=
"True"
MinWidth
=
"50"
Width
=
"2*"
TextWrapping
=
"Wrap"
/>
<
telerik:GridViewDataColumn
Name
=
"ColAssignedTo"
DataMemberBinding
=
"{Binding AssignedTo}"
Header
=
"Assigned To"
IsReadOnly
=
"True"
MinWidth
=
"50"
Width
=
"*"
MaxWidth
=
"200"
/>
<
telerik:GridViewDataColumn
Name
=
"ColNotes"
DataMemberBinding
=
"{Binding Notes}"
Header
=
"Notes"
IsReadOnly
=
"True"
MinWidth
=
"50"
Width
=
"3*"
TextWrapping
=
"Wrap"
/>
<
telerik:GridViewDataColumn
Name
=
"ColDate"
DataMemberBinding
=
"{Binding DateAdded}"
DataFormatString
=
"dd/MM/yy hh:mm tt"
Header
=
"Date"
IsReadOnly
=
"True"
MinWidth
=
"50"
Width
=
"70"
/>
<
telerik:GridViewDataColumn
Name
=
"ColSite"
DataMemberBinding
=
"{Binding Site_Name}"
Header
=
"Site"
IsReadOnly
=
"True"
MinWidth
=
"50"
Width
=
"50"
/>
<
telerik:GridViewDataColumn
Name
=
"ColT"
Header
=
"T"
IsReadOnly
=
"True"
MinWidth
=
"70"
Width
=
"*"
MinWidth
=
"50"
Width
=
"50"
/>
<
telerik:GridViewDataColumn
Name
=
"ColAssignedToFullAbbr"
DataMemberBinding
=
"{Binding FullAbbr}"
Header
=
"Assigned To"
IsReadOnly
=
"True"
MinWidth
=
"70"
Width
=
"1*"
/>
<
telerik:GridViewDataColumn
Name
=
"ColReceived"
DataMemberBinding
=
"{Binding NotifiedOn}"
DataFormatString
=
"dd/MM/yy hh:mm tt"
Header
=
"Received"
IsReadOnly
=
"True"
MinWidth
=
"70"
Width
=
"70"
/>
<
telerik:GridViewDataColumn
Name
=
"ColR"
Header
=
"R"
IsReadOnly
=
"True"
MinWidth
=
"50"
Width
=
"50"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
</
Grid
>
Currently when the RGV is filled the columns expand past the edge of the window. I'd like them to fit to the window.
Because this is likely related to fitting the RGV to the window, here are further details about the columns:
Columns ColSubject, ColNotes, and ColAssignedToFullAbbr are the variable width columns, with ColNotes taking up the most space, followed by ColSubject, then ColAssignedToFullAbbr. I'm not sure whether functionality exists for this, but I've also put minimum widths for the other columns so that should the variable width columns require more space, space up to a certain amount can be given to them from the other columns. Finally, should the variable width columns still require more space, I'd like the text to wrap, hence I've added TextWrapping="Wrap".
If it matters, I've tried setting a fixed size to the window containing this UserControl, and a similar result occurs.
Any help is appreciated.