in

CodeSmith Community

Your Code. Your Way. Faster!

Sort on deeploaded field

Last post 01-17-2008 11:53 AM by mark.zigman. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 11-08-2007 1:51 AM

    • Wookai
    • Not Ranked
    • Joined on 10-01-2007
    • Posts 4
    • Points 80

    Sort on deeploaded field

    Hi !

     I have a GridView filled using a strongly typed datasource, in which one more more fields are deeploaded (see code below for an example).

     <data:RegionDataSource ID="__regionDS" runat="server"
        SelectMethod="GetPaged"
        UpdateMethod="update"
        EnableDeepLoad="true"
        >
        <DeepLoadProperties Method="includechildren" Recursive="false">
            <Types>
                <data:RegionProperty Name="Country" />
            </Types>
        </DeepLoadProperties>
    </data:RegionDataSource>
        
    <asp:GridView ID="__regionGV" runat="server"
        DataSourceID="__regionDS"
        AutoGenerateColumns="false"
        AllowSorting="true"
        DataKeyNames="Id"
        >
        <Columns>
            <asp:BoundField DataField="Name" HeaderText="Nom" SortExpression="Name" />
            <asp:TemplateField HeaderText="Pays">
                <ItemTemplate>
                    <%# Eval("CountryIdSource.Name") %>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        
    </asp:GridView>

     I would like to allow to sort this gridview on both columns. The first one is not a problem, but I don't know how to sort on the deeploaed field "CountryIdSource.Name". Could someone please explain me how to do this, keeping in mind that I'd like to keep usage of the strongly typed datasource (it's really useful !!).

    Thanks in advance ! 

    Wookai
    • Post Points: 35
  • 01-17-2008 11:53 AM In reply to

    Re: Sort on deeploaded field

    I have the same exact problem!!!  Deeploaded fields cause the grids not to sort!!!  Please help!!!

    • Post Points: 5
Page 1 of 1 (2 items)
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems