Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
444
WebDatatGrid sort on templated field?
posted

Normal 0 false false false MicrosoftInternetExplorer4

http://ko.infragistics.com/dotnet/netadvantage/aspnet/webdatagrid/sorting.aspx

Hi There,

I have a sorting issue with the webdatagrid and perhaps you can help.

I am using a linqdatasource and the main table this is pointing to is a table of foreign keys mostly.

I am using Templated fields to bring in data from the other tables and hiding the Id fields.

See samples code.

 

<ig:TemplateDataField Key="RevenueLine">

                 <ItemTemplate>

                     <asp:PlaceHolder ID="plcRevenueLine" runat="server">

                     <%#DataBinder.Eval(DirectCast(Container, Infragistics.Web.UI.TemplateContainer).DataItem, "RevenueLine.REVL_Description")%>

                     </asp:PlaceHolder>

                 </ItemTemplate>

                 <Header Text="Revenue Line" />

             </ig:TemplateDataField>

             <ig:BoundDataField CssClass="hiddenColumn" DataFieldName="PRDM_CMPY_ID"

                 Key="PRDM_CMPY_ID" Width="0px">

             </ig:BoundDataField>

             <ig:TemplateDataField Key="Company">

                 <ItemTemplate>

                     <asp:PlaceHolder ID="plcCompany" runat="server">

                     <%#DataBinder.Eval(DirectCast(Container, Infragistics.Web.UI.TemplateContainer).DataItem, "Company.CMPY_Description")%>

                     </asp:PlaceHolder>

                 </ItemTemplate>

                 <Header Text="Company" />

             </ig:TemplateDataField>

             <ig:BoundDataField CssClass="hiddenColumn" DataFieldName="PRDM_PVTL_ID"

                 Key="PRDM_PVTL_ID" Width="0px">

             </ig:BoundDataField>

 

My question is, can I sort by these items? For example when a user clicks the “Company” column, I want to sort the grid by “Company.CMPY_Description”. How do I set this up.

 

Thanks for any advice.

 

Chris in San Diego

Parents
No Data
Reply Children
No Data