Thanks in advance,
Lars
10 Answers, 1 is accepted
Thanks again
Currently there is no way to manually control the loading indicator and our selection mechanism cannot be disabled.
Are any of those limitations a show-stopper for you?
I could think of only one workaround to disable our selection machanism but it will also disable features like editing. The trick is to set the IsHitTestVisible property to false.
| <Grid.Resources> |
| <Style x:Key="CustomStyle" TargetType="grid:GridViewRow"> |
| <Setter Property="IsHitTestVisible" Value="False"/> |
| </Style> |
| </Grid.Resources> |
| <telerikGrid:RadGridView x:Name="RadGridView1" RowStyle="{StaticResource CustomStyle}"> |
| </telerikGrid:RadGridView> |
Thanks for your valuable feedback - I have updated your telerik points.
Greetings,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Thanks for the response, I don't believe these things should be show stoppers. I have a grid with a child table so I was looking to have only one record (between the parent/child tables) selected at a time, and I believe I've come up with a solution for that. I do have a couple more questions about the grids though:
1. Is there anyway to have the columns fill the child grids? (see screen shot)
2. Is there anyway to remove the row indicator column in child grids (see screen shot)
3. How would I go about removing the child grid's header row background gradient?
4. Is there anyway to edit the grouping row?, I'd like to add a textbox with a description to the grouping.
My code for the child tables
Xaml:
| <telerikGridView:RadGridView.HierarchyChildTemplate> |
| <DataTemplate> |
| <StackPanel Background="White" Height="auto" > |
| <telerikGridView:RadGridView Margin="10,10,10,10" CanUserFreezeColumns="False" VerticalGridlinesVisibility="Collapsed" |
| ShowGroupPanel="False" IsFilteringAllowed="False" Background="White" |
| ColumnsWidthMode="Fill" SelectionChanged="RadGridView_SelectionChanged" Loaded="RadGridView_Loaded"> |
| </telerikGridView:RadGridView> |
| </StackPanel> |
| </DataTemplate> |
| </telerikGridView:RadGridView.HierarchyChildTemplate> |
CS:
| var relation = new TableRelation(); |
| relation.FieldNames.Add(new FieldDescriptorNamePair("JobDate", "JobDate")); |
| relation.FieldNames.Add(new FieldDescriptorNamePair("JobID", "JobID")); |
| var definition = new GridViewTableDefinition(); |
| definition.AutoGenerateFieldDescriptors = false; |
| var column = new GridViewDataColumn(); |
| column.DataMemberBinding = new Binding("Supervisor"); |
| column.HeaderText = "Supervisor"; |
| definition.FieldDescriptors.Add(column); |
| column = new GridViewDataColumn(); |
| column.DataMemberBinding = new Binding("LaborCost"); |
| column.HeaderText = "Labor Cost"; |
| column.DataFormatString = "{0:c}"; |
| definition.FieldDescriptors.Add(column); |
| column = new GridViewDataColumn(); |
| column.DataMemberBinding = new Binding("EquipmentCost"); |
| column.HeaderText = "EQ Cost"; |
| column.DataFormatString = "{0:c}"; |
| definition.FieldDescriptors.Add(column); |
| column = new GridViewDataColumn(); |
| column.DataMemberBinding = new Binding("SiteCost"); |
| column.HeaderText = "Site Cost"; |
| column.DataFormatString = "{0:c}"; |
| definition.FieldDescriptors.Add(column); |
| column = new GridViewDataColumn(); |
| column.DataMemberBinding = new Binding("SiteID"); |
| column.HeaderText = "Site"; |
| definition.FieldDescriptors.Add(column); |
| definition.IsReadOnly = true; |
Thanks for all of your help!
System.Windows.Data Error: BindingExpression path error: 'VerticalGridlinesVisibility' property no found on 'SPECIALTY ITEMS' 'Telerik.Windows.Data.AggregateResult' (HashCode=23150067). BindingExpression: Path='VerticalGridlinesVisibility' DataItem='SPECIALTY ITEMS' (HashCode=23150067); target element is 'Telerik.Windows.Controls.GridView.GridViewAggregateResultCell' (Name=''); target property is 'VerticalLineVisibility' (type 'System.Windows.Visibility')..
System.Windows.Data Error: BindingExpression path error: 'VerticalGridlinesBrush' property no found on 'SPECIALTY ITEMS' 'Telerik.Windows.Data.AggregateResult' (HashCode=23150067). BindingExpression: Path='VerticalGridlinesBrush' DataItem='SPECIALTY ITEMS' (HashCode=23150067); target element is 'Telerik.Windows.Controls.GridView.GridViewAggregateResultCell' (Name=''); target property is 'VerticalLineFill' (type 'System.Windows.Media.Brush')..
System.Windows.Data Error: BindingExpression path error: 'VerticalGridlinesThickness' property no found on 'SPECIALTY ITEMS' 'Telerik.Windows.Data.AggregateResult' (HashCode=23150067). BindingExpression: Path='VerticalGridlinesThickness' DataItem='SPECIALTY ITEMS' (HashCode=23150067); target element is 'Telerik.Windows.Controls.GridView.GridViewAggregateResultCell' (Name=''); target property is 'VerticalLineThickness' (type 'System.Double')..
If there are too many levels of grouping it will just exit the application. Any help would be greatly appreciated, this is much more important than the other questions I've had as I have a presentation to give this week.
Thanks again for all of your help.
Lars
You have correctly set the ColumnsWidthMode property to Fill. Unfortunately there is a know inssue with that mode when hierachy is involved. There is a possible workaround, though - if you set a concrete width of your child grid your columns should fill all of the available space.
You can use the RadGridView.RowIndicatorVisibility property to control the visibility of the indicator . If you set it to Collapsed the indicator will not be displayed.
The gradient that you see on our header row is also applied to every header cell. In order to remove it you have to change the background of every header row and every header cell. Our columns have a propetry called HeaderCellStyle that can be use to change the appearance of the header cells but since you are using autogenerated columns in you should do that in code-behind.
First you should hook up to the RadGridView.RowLoaded event and in the event handler do something like that:
| private void RadGridView_RowLoaded(object sender, RowLoadedEventArgs e) |
| { |
| GridViewHeaderRow row = e.Row as GridViewHeaderRow; |
| if(row == null) |
| return; |
| row.Background = new SolidColorBrush(Colors.Transparent); |
| foreach (var cell in row.Cells) |
| { |
| cell.Background = new SolidColorBrush(Colors.Transparent); |
| } |
| } |
GridViewDataControl and RadGridView expose a property called GroupRowStyle that allows you to customize the look of our group rows. I have attached a sample project that demonstrated how you can change the looks of the group row.
We are currently looking into the binding errors that you have reported and we will update you on the matter as soon as posible.
All the best,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Is there an ETA to fix the issue with the ColumnsWidthMode property? We're running into the same problem that Lars mentions in his "item 1".
Thanks,
Ron
We aim to fix this problem for Q2 SP1. Is it possible to use the fixed size workaround that I have mentioned in my last post? Is the workaround applicable to your scneraio?
Sincerely yours,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Well, if the RadGridView is in a panel that provides an infinite width to the grid, there is no way to determine the right column sizes that will fill the grid. Still, there might be a workaround that you can use.
| <Grid x:Name="LayoutRoot" Background="White"> |
| <Grid.RowDefinitions> |
| <RowDefinition Height="Auto"/> |
| </Grid.RowDefinitions> |
| <Grid.ColumnDefinitions> |
| <ColumnDefinition Width="Auto"/> |
| </Grid.ColumnDefinitions> |
| <StackPanel Grid.Row="0" Grid.Column="0" SizeChanged="StackPanel_SizeChanged" > |
| <telerikGrid:RadGridView x:Name="RadGridView1" ColumnsWidthMode="Fill"> |
| </telerikGrid:RadGridView> |
| </StackPanel> |
| </Grid> |
In this situation the fill mode will not work correctly. If you subscribe to the SizeChanged event of the parent StackPanel you will be able to determine the concrete size of the parent. You can use this size to limit the size of the grid:
| private void StackPanel_SizeChanged(object sender, SizeChangedEventArgs e) |
| { |
| FrameworkElement element = (FrameworkElement)VisualTreeHelper.GetChild((DependencyObject)sender, 0); |
| element.Width = e.NewSize.Width; |
| element.Height = e.NewSize.Height; |
| } |
Hope this works for your scenario.
Greetings,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.