This is a migrated thread and some comments may be shown as answers.

[Solved] HierarchyChild Not Getting Bindded(Have to do with out Code in xaml.cs)

6 Answers 227 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Justin Manjooran
Top achievements
Rank 1
Justin Manjooran asked on 06 Nov 2009, 07:34 AM
Constructor 

        public CountryView()
        {
            InitializeComponent(); 
            GridViewTableDefinition detailDefinition = new GridViewTableDefinition();
            detailDefinition.Relation = new PropertyRelation("ID");
            countryRadGridView.TableDefinition.ChildTableDefinitions.Add(detailDefinition);
        } 

.xaml
      <telerikGridView:RadGridView  Grid.Row="1" Margin="8,8,8,8" 
                                      x:Name="countryRadGridView"
                                      UseAlternateRowStyle="True"
                                      UseLayoutRounding="True"
                                      ColumnsWidthMode="Fill"
                                      AutoGenerateColumns="False" 
                                      ItemsSource="{Binding CountryList, Mode=TwoWay }">
            <telerikGridView:RadGridView.Columns>
                <telerikGridView:GridViewDataColumn HeaderText="ID" IsReadOnly="True" DataMemberBinding="{Binding ID, Mode=TwoWay}" />
                <telerikGridView:GridViewDataColumn HeaderText="Country Name"  IsReadOnly="True" DataMemberBinding="{Binding Name, Mode=TwoWay}" />
            </telerikGridView:RadGridView.Columns>
            <telerikGridView:RadGridView.HierarchyChildTemplate>
                <DataTemplate>
                        <telerikGridView:RadGridView Margin="45,8,30,8" UseAlternateRowStyle="True" x:Name="stateRadGridView" ItemsSource="{Binding StateList, Mode=TwoWay}" ColumnsWidthMode="Fill"
                         AutoGenerateColumns="False">
                            <telerikGridView:RadGridView.Columns>
                                <telerikGridView:GridViewDataColumn HeaderText="State ID" IsReadOnly="True" DataMemberBinding="{Binding ID, Mode=TwoWay}" Width="100" />
                                <telerikGridView:GridViewDataColumn HeaderText="State Name" IsReadOnly="True" DataMemberBinding="{Binding Name, Mode=TwoWay}"  Width="130" />
                            </telerikGridView:RadGridView.Columns>
                        </telerikGridView:RadGridView>
                </DataTemplate>
            </telerikGridView:RadGridView.HierarchyChildTemplate>
        </telerikGridView:RadGridView>



I have binded the CountryList to ItemsSource of countryRadGridView through ViewModel which work fine and only the country list get binded  StateList doesnot get Binded on clicking the + . StateList  contains data for sure.

CountryList is a list class of country

    public class County
    {
public int ID {get;set;}
public string Name  {get;set;}
public List<State> StateList  {get;set;}
   }

    public class State
    {
public int ID {get;set;}
public string Name  {get;set;}
   }
  

Issue
 StateList doesnot get Binded on clicking the +


Note:
 I could not set ChildTableDefinitions in xaml Instead I have done it xaml.cs

when I tried this in xaml it did not support
            <telerik:RadGridView.ChildTableDefinitions>
                <telerik:GridViewTableDefinition />
            </telerik:RadGridView.ChildTableDefinitions>




6 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 06 Nov 2009, 07:58 AM
Hi,

Can you provide a bit more info about your grid version? I'm not sure also form your post where the child table is declared finally - in code, in xaml or both - can you please clarify again?

Sincerely yours,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Justin Manjooran
Top achievements
Rank 1
answered on 06 Nov 2009, 08:36 AM
 I could not set ChildTableDefinitions in xaml Instead I have done it in xaml.cs constructor

When I tried to put in xaml it did not support

Product  Version 2009.1.0526.1020  (Does this determine the version)

 




0
Vlad
Telerik team
answered on 06 Nov 2009, 08:48 AM
Hi Justin,

This version actually is our first build against Silverlight 3 beta - can you upgrade to our Q2 SP1 at least? Upgrading to Q3 will be even better!

Sincerely yours,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Justin Manjooran
Top achievements
Rank 1
answered on 09 Nov 2009, 07:07 AM
Thank you for your quick reply
Binding worked fine after upgrading the dll

Now one more issue

How to fire a double click event on the inner grid 




0
Justin Manjooran
Top achievements
Rank 1
answered on 09 Nov 2009, 12:35 PM
How to fire a double click event on the inner grid
0
Vlad
Telerik team
answered on 12 Nov 2009, 07:32 AM
Hello ,

I've attached small example using the binaries from our latest internal build.

Regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Justin Manjooran
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Justin Manjooran
Top achievements
Rank 1
Share this question
or