set datanavigateurlformatstring to different pages based on datakeyname

2 posts, 0 answers
  1. Robin
    Robin avatar
    10 posts
    Member since:
    Sep 2015

    Posted 24 May 2019 Link to this post

    I have a RadGrid with a gridhyperlinkcolumn.  I want to set the url differently depending on a datakey value.  How can i do this? here is my code snippet

      <telerik:RadGrid ID="RadGrid1" runat="server" datakeynames="applicationid" allowsorting="true" DataSourceID="LOISubmitted" AutoGenerateColumns="False" CellSpacing="-1" GridLines="Both">
                        <GroupingSettings CollapseAllTooltip="Collapse all groups" />
                            <Selecting AllowRowSelect="True" UseClientSelectColumnOnly="true" />
                        <MasterTableView DataSourceID="LOISubmitted" DataKeyNames="applicationid" AllowMultiColumnSorting="true"  CommandItemDisplay="top" Font-Names="Trebuchet MS">
                               <CommandItemSettings ShowExportToExcelButton="true" showaddnewrecordbutton="false"/>
                             <telerik:GridHyperLinkColumn DataNavigateUrlFields="applicationid, applicationtype"  itemstyle-width="40%" DataTextField="fiscalorgname" HeaderText="Fiscal Organization" SortExpression="fiscalorgname" UniqueName="fiscalorgname"  ></telerik:GridHyperLinkColumn>
                                <telerik:GridBoundColumn DataField="behalfof" HeaderText="On Behalf of" SortExpression="behalfof" UniqueName="behalfof" FilterControlAltText="Filter behalfof column" ItemStyle-width="30%"></telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="applicationperiod" HeaderText="Application Period" SortExpression="applicationperiodid">  </telerik:GridBoundColumn>

  2. Attila Antal
    Attila Antal avatar
    514 posts

    Posted 29 May 2019 Link to this post

    Hi Robin,

    The following documentation article describes how to access cells, values, data key values and more: Accessing Cells and Rows. The instructions from these articles will help you achieve the required behavior.

    Please try it out and if you require additional assistance on this, let us know.

    Kind regards,
    Attila Antal
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top