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

Select Row on GridHyperLinkColumn click

1 Answer 144 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 19 Oct 2011, 08:37 PM

Hello,

Is there a way to select the GridHyperLinkColumn row via the designer when clicking the particular link in the designer for the grid?  If not, how would I accomplish this task via server-side code?

I have attached the designer code for my grid.

<table width="100%" border="0" cellpadding="0" cellspacing="0" class="GridStyle">
<tr>
    <td>
        <telerik:RadGrid ID="RadGridDrillDown" runat="server" 
            AutoGenerateColumns="false" AllowSorting="True" AllowPaging="true" Skin="Simple" ClientSettings-Resizing-AllowColumnResize="true"
            ItemStyle-Wrap="false" Width="95%" HeaderStyle-Wrap="false" PageSize="10"
            OnNeedDataSource="RadGridDrillDown_NeedDataSource" OnItemDataBound="RadGridDrillDown_ItemDataBound">
            <PagerStyle Mode="NumericPages" />
            <ClientSettings>
                <Scrolling AllowScroll="true" UseStaticHeaders="true"  />
            </ClientSettings>
            <MasterTableView TableLayout="Fixed" AllowMultiColumnSorting="true" DataKeyNames="SampleDetailId" ShowFooter="false" PagerStyle-AlwaysVisible="false" >
                <NoRecordsTemplate>
                    <asp:Label ID="lblMsg" runat="server" Text="No Records found"></asp:Label>
                </NoRecordsTemplate>
                <Columns>
                    <telerik:GridHyperLinkColumn HeaderText="Order #" HeaderButtonType="TextButton" DataTextField="OrderNumber" DataTextFormatString="{0}" 
                        DataNavigateUrlFields="SampleDetailId" DataNavigateUrlFormatString="CustomerSearch.aspx?SampleDetailId={0}" HeaderStyle-Width="100" />
                    <telerik:GridBoundColumn HeaderText="Type" HeaderButtonType="TextButton" DataField="Category2" HeaderStyle-Width="100" />
                    <telerik:GridBoundColumn HeaderText="Status" HeaderButtonType="TextButton" DataField="OrderStatus" HeaderStyle-Width="200" />
                    <telerik:GridDateTimeColumn HeaderText="Ship Date" HeaderButtonType="TextButton" DataField="ShipDate" DataFormatString="{0:dd/MM/yyyy}" HeaderStyle-Width="200" />
                    <telerik:GridBoundColumn HeaderText="First Name" HeaderButtonType="TextButton" DataField="RequestorFirstName" HeaderStyle-Width="200" />
                    <telerik:GridBoundColumn HeaderText="Last Name" HeaderButtonType="TextButton" DataField="RequestorLastName" HeaderStyle-Width="200" />
                    <telerik:GridBoundColumn HeaderText="PD" HeaderButtonType="TextButton" DataField="RequestorPd" HeaderStyle-Width="50" />
                    <telerik:GridBoundColumn HeaderText="Facility Name" HeaderButtonType="TextButton" DataField="InstitutionName" HeaderStyle-Width="200" />
                    <telerik:GridBoundColumn HeaderText="State" HeaderButtonType="TextButton" DataField="RequestorState" HeaderStyle-Width="100" />
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </td>
</tr>
</table>


Thanks,

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 20 Oct 2011, 04:55 AM
Hello Tom,

GridHyperlinkColumn is used for navigation. To select rows you can either use Linkbutton in GridTemplateColumn or GridButtonColumn with ButtonType as LinkButton and CommandName as select. Here is the documentation.

Column Types

Thanks,
Princy.
Tags
Grid
Asked by
Tom
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or