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 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" />
                        <ClientSettings>
                            <Selecting AllowRowSelect="True" UseClientSelectColumnOnly="true" />
                        </ClientSettings>
                        <MasterTableView DataSourceID="LOISubmitted" DataKeyNames="applicationid" AllowMultiColumnSorting="true"  CommandItemDisplay="top" Font-Names="Trebuchet MS">
                               <CommandItemSettings ShowExportToExcelButton="true" showaddnewrecordbutton="false"/>
                            <Columns>
                           
                             <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>
                            </Columns>
                           
                        </MasterTableView>
                    </telerik:RadGrid>

  2. Attila Antal
    Admin
    Attila Antal avatar
    428 posts

    Posted 29 May 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