Print Page | Close Window

Navigation problem....

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2319
Printed Date: 20-May-2025 at 3:54pm


Topic: Navigation problem....
Posted By: bala
Subject: Navigation problem....
Date Posted: 19-Nov-2010 at 9:57am
Hi
I am try to using navigation.I can get the value who has one-many relation
but its not possible to getting value who has many to many relation.
I want to navigate from xmal file. Like I am acessing value of PERFIL
 <dxg:AgDataGridColumn FieldName="PESSOA_TIPO_USUARIO_PERFIL.DESCRICAO" HeaderContent="Perfil" MaxColumnWidth="Infinity"
 MinColumnWidth="150" SortIndex="-1" GroupIndex="-1" Visible="True" Width="250" />
same I want to acess value of others which are not in direct relation.
I want to get the value of NOME  its in PESSOA_FISICA and Email its in PESSOA_EMAIL.
..

I am attaching my grid and EDM below.
Any Help.



Replies:
Posted By: DenisK
Date Posted: 22-Nov-2010 at 11:47am
Hi bala;

Here's an example to achieve what you want using the NorthwindIB database.

1. First query the related entities.

public void LoadDataGridFromIndirectlyRelatedEntity() {
      Orders = new ObservableCollection<Order>();

      //This is also called a multi-leg include. See  http://drc.ideablade.com/xwiki/bin/view/Documentation/AddIncludeToQuery - http://drc.ideablade.com/xwiki/bin/view/Documentation/AddIncludeToQuery
      var ordersQuery = _mainMgr.Orders
        .Include(o => o.Customer)
        .Include("OrderDetails.Product.Supplier");

      ordersQuery.ExecuteAsync(e => {
        e.Results.ForEach(Orders.Add);
      });
    }

2. Bind to the data grid. I'm not an expert on DevExpress AgDataGrid so I'm using the Silverlight DataGrid as an example.

<sdk:DataGrid Name="OrdersGrid" 
                      AutoGenerateColumns="False"                      
                      ItemsSource="{Binding Orders}"
                      SelectionMode="Single"
                      Grid.Row="0">
            <sdk:DataGrid.Columns>
                <sdk:DataGridTextColumn
                    Binding="{Binding OrderID}"
                    CanUserReorder="True"
                    CanUserResize="True"
                    CanUserSort="True"
                    Width="Auto" />
                <sdk:DataGridTextColumn
                    Binding="{Binding Customer.CompanyName}"
                    CanUserReorder="True"
                    CanUserResize="True"
                    CanUserSort="True"
                    Width="Auto" />
                <sdk:DataGridTextColumn
                    Header="Count of OrderDetails"
                    Binding="{Binding OrderDetails.Count}"
                    CanUserReorder="True"
                    CanUserResize="True"
                    CanUserSort="True"
                    Width="Auto" />
            </sdk:DataGrid.Columns>
        </sdk:DataGrid>
        
        <sdk:DataGrid Name="CustomersGrid"
                      AutoGenerateColumns="False"
                      ItemsSource="{Binding ElementName=OrdersGrid, Path=SelectedItem.OrderDetails}"
                      SelectionMode="Single"
                      Grid.Row="1">
            <sdk:DataGrid.Columns>
                <sdk:DataGridTextColumn
                    Binding="{Binding OrderID}"
                    CanUserReorder="True"
                    CanUserResize="True"
                    CanUserSort="True"
                    Width="Auto" />
                <sdk:DataGridTextColumn
                    Binding="{Binding Order.ShipCity}"
                    CanUserReorder="True"
                    CanUserResize="True"
                    CanUserSort="True"
                    Width="Auto" />
                <sdk:DataGridTextColumn
                    Binding="{Binding Product.ProductName}"
                    CanUserReorder="True"
                    CanUserResize="True"
                    CanUserSort="True"
                    Width="Auto" />
                <sdk:DataGridTextColumn
                    Binding="{Binding Product.Supplier.CompanyName}"
                    CanUserReorder="True"
                    CanUserResize="True"
                    CanUserSort="True"
                    Width="Auto" />
            </sdk:DataGrid.Columns>
        </sdk:DataGrid>

You can see here for information on how to do it using the AgDataGrid. 

http://www.devexpress.com/Support/Center/p/Q238939.aspx - http://www.devexpress.com/Support/Center/p/Q238939.aspx


Posted By: bala
Date Posted: 25-Nov-2010 at 10:04am
Hi Denisk

Thanks for reply
But with this multi leg  not able to achieved the resutl. I trace my result at certain
level query collapsing..
Function evaluation disabled because a previous function evaluation timed out.
You must continue execution to reenable function evaluation.    IdeaBlade.EntityModel.RelatedEntityList<Crmall.Entities.PESSOA_TIPO_LOJA_SHOPPING>

I am getting such type of error when i debugging data..

Is there anotherway to achieved ???


With Best


Posted By: bala
Date Posted: 02-Dec-2010 at 9:24am
... And I am preety sure there is no problem in Binding with AgDataGrid..

Somewhere Query has problem ...


THanks



Print Page | Close Window