This question is locked. New answers and comments are not allowed.
Hi,
I would like to have a cell template for the ChildTable to display the color like in the "main" table.
How can I archive this?
Thanks,
Martin
Here is my code:
<telerik:RadGridView.ChildTableDefinitions> <telerik:GridViewTableDefinition> <telerik:GridViewTableDefinition.Relation> <telerik:PropertyRelation ParentPropertyName="Relation"/> </telerik:GridViewTableDefinition.Relation> </telerik:GridViewTableDefinition> </telerik:RadGridView.ChildTableDefinitions> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn Header="Color" DataMemberBinding="{Binding Color}"> <telerik:GridViewDataColumn.CellTemplate> <DataTemplate> <Border Width="30" Height="20" Background="{Binding Color}"/> </DataTemplate> </telerik:GridViewDataColumn.CellTemplate> </telerik:GridViewDataColumn> <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Name}"> </telerik:GridViewDataColumn> </telerik:RadGridView.Columns> </telerik:RadGridView>
9 Answers, 1 is accepted
0
Hello Martin,
You can define a CellTemplate for child tables using Custom Hierachy Template.
If you need any further assistance, please let me know.
All the best,
Vanya Pavlova
the Telerik team
You can define a CellTemplate for child tables using Custom Hierachy Template.
If you need any further assistance, please let me know.
All the best,
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
Martin
Top achievements
Rank 1
answered on 24 Sep 2010, 01:53 PM
Thank you - that helped me alot.
But I have another question. When I select a Item in the ChildTable - how can I get the SelectedItem?
If I use radGridview.SelectedItem I get "null".
Thanks,
Martin
But I have another question. When I select a Item in the ChildTable - how can I get the SelectedItem?
If I use radGridview.SelectedItem I get "null".
Thanks,
Martin
0
Hello Martin,
As you defined a HierachyChildTemplate, you can use the RowLoaded event to access rows in child grids-please use the following forum thread for a reference.
Greetings,
Vanya Pavlova
the Telerik team
As you defined a HierachyChildTemplate, you can use the RowLoaded event to access rows in child grids-please use the following forum thread for a reference.
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
0
Martin
Top achievements
Rank 1
answered on 24 Sep 2010, 03:48 PM
Hello Vanya,
thanks for your answer. That does not help me getting the SelectedItem from the ChildRow. I need the Selected Item of the Child Row when it's selected by the costumer.
Thanks,
Martin
thanks for your answer. That does not help me getting the SelectedItem from the ChildRow. I need the Selected Item of the Child Row when it's selected by the costumer.
Thanks,
Martin
0
Hi Martin,
You can use the SelectionChanged event of the child gridview to get the selected item. You can store it in a variable and use it later when you need it.
Best wishes,
Veselin Vasilev
the Telerik team
You can use the SelectionChanged event of the child gridview to get the selected item. You can store it in a variable and use it later when you need it.
Best wishes,
Veselin Vasilev
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
Martin
Top achievements
Rank 1
answered on 29 Sep 2010, 07:32 AM
I tried it. But sometimes I get no result. Do you have any examples?
0
Hello Martin,
You may use the following code:
Regards,
Vanya Pavlova
the Telerik team
You may use the following code:
private void childGrid_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e) { var item = this.childGrid.SelectedItem as MyObject; MessageBox.Show(item.ID.ToString()); } Regards,
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
Martin
Top achievements
Rank 1
answered on 29 Sep 2010, 10:57 AM
That does not work either - for some childGrids I don't get the selected item, its "null".
Is this a bug ?
Is this a bug ?
0
Hi Martin,
Everything works fine on my side, please submit a support ticket and send us a small application that reproduces this behavior, because obviously there is something specific in your scenario.
Greetings,
Vanya Pavlova
the Telerik team
Everything works fine on my side, please submit a support ticket and send us a small application that reproduces this behavior, because obviously there is something specific in your scenario.
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