This is a migrated thread and some comments may be shown as answers.

set datanavigateurlformatstring to different pages based on datakeyname

1 Answer 34 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robin
Top achievements
Rank 1
Robin asked on 24 May 2019, 05:55 PM

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>

1 Answer, 1 is accepted

Sort by
0
Attila Antal
Telerik team
answered on 29 May 2019, 08:53 AM
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.
Tags
Grid
Asked by
Robin
Top achievements
Rank 1
Answers by
Attila Antal
Telerik team
Share this question
or