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

Hyperlink inside Radgrid as a column

0 Answers 108 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sweatha
Top achievements
Rank 1
Sweatha asked on 21 Apr 2017, 02:11 PM

Hi,

Could someone please let me know how to implement on click functionality of hyperlink which is inside a radgrid. Radgrid has been binded with datatable dynamically. Radgrid autogeneratecolumns has been given as true.

on click of hyperlink a command prompt should open and run the command as requested.

Asp.Net:

<telerik:RadGrid ID="radgrid1" runat="server" AutoGenerateColumns="true"
                        Width="100%" GridLines="None" CellPadding="0" AllowPaging="True" AllowSorting="True" OnItemDataBound="radgrid1_ItemDataBound"                      
                        PageSize="200" >
                        <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>                                                 
                    </telerik:RadGrid>

C#:

protected void radgrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem item = (GridDataItem)e.Item;
            cmdArgument = item["command"].Text;
            HyperLink link = new HyperLink();
            link.Text = item["command"].Text;
            item["accurev_command"].Controls.Add(link);

}

}

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Sweatha
Top achievements
Rank 1
Share this question
or