Skip to content

Infragistics Community Forum / Web / Ultimate UI for ASP.NET Web Forms / How to set a column with hyperlink property for webdatagrid?

How to set a column with hyperlink property for webdatagrid?

New Discussion
Jeevitha Manickam
Jeevitha Manickam asked on Nov 4, 2014 10:50 AM

Hi,

Migrating from Infragistics 7.3 to 13.1.

private void Ultrawebgrid1_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e)
{
UltraGridColumn Name = existingColumns.FromKey(“Name”);
Name.Type = ColumnType.HyperLink;
}

How to set a column with hyperlink property for webdatagrid?

Please provide sample in C# code behind.

Any help is highly appreciated. Please advice urgently.

Sign In to post a reply

Replies

  • 0
    Jose Acevedo
    Jose Acevedo answered on Oct 28, 2014 10:23 PM

    Hello Jeevitha Manickam,

    Thank you for posting on our forums.

    The WebDataGrid doesn’t have a Type property used to set the value as a Hyperlink. Instead, I recommend using a Template Field as the column, and adding an ASP.NET HyperLink control to display a HyperLink style for the values of each column.

    I recommend setting up the layout of the Template using inline markup as demonstrated in the linked thread

    To learn more about Columns for the WebDataGrid, please refer to the Columns help topic in our documentation.

    Please let me know if you have any questions regarding this matter.

    • 0
      Jeevitha Manickam
      Jeevitha Manickam answered on Oct 29, 2014 11:30 AM

      Hi Jose, 

      Appreciate for replying my query.

      The link which u provided me doesnt hold any sample to handle hyperlink in c# code behind.(dynamically)

      Please provide a sample such that hyperlink is created for a column in InitializeRow using RowEventArgs.

      Expecting your help at the earliest.

      • 0
        Jose Acevedo
        Jose Acevedo answered on Oct 30, 2014 8:11 PM

        Hi Jeevitha,

        Thank you for the update.

        As you’ve requested, I’ve attached a sample which demonstrates how to dynamically handle the hyperlink for each row using the InitializeRow event. Note, I was able to get a reference to the Hyperlink control in the template using the FindControl method. This will allow you to dynamically set the hyperlink properties for each row in the code behind.

        Please review the sample and let me know if you have any questions.

      • 0
        Jeevitha Manickam
        Jeevitha Manickam answered on Oct 31, 2014 9:33 AM

        Hi Jose,

        My code is like this.
        void WebdataGrid1_InitializeRow(object sender, RowEventArgs e)
        {
        if (e.Row.Index == 0)
        {
        e.Row.Items[3].Column.Key = c_sName;
        e.Row.Items[3].Column.Header.Text = NameText();
        e.Row.Items[3].Column.Width = Unit.Pixel(250);

        HyperLink link = e.Row.Items[3].FindControl("Link1") as HyperLink;
        link.Text = e.Row.Index.ToString();
        }
        }

        I want set this name field( just this column for all the row values) as hyperlink.

        HyperLink link = e.Row.Items[3].FindControl("Link1") as HyperLink;
        link.Text = e.Row.Index.ToString();

        Doesn't seem to give me what i expected. Could u please let me know where iam missing.

        Its higly crictical. Expecting ur reply asap.

        Thanks in advance.

      • 0
        Jose Acevedo
        Jose Acevedo answered on Nov 3, 2014 3:38 PM

        Hi Jeevitha,

        Thank you for the update.

        The sample I’ve provided demonstrates how to dynamically handle the hyperlink for each row using the InitializeRow event.  The pre-requisite for my sample requires you to already have the hyperlink-template-column setup inline using markup. If you wish to configure the grid to use hyperlinks for each row in a column using only the code-behind, please review the sample I’ve attach to this post.

        Please note, I recommend reviewing our API documentation to learn more about the WebDataGrid.

      • 0
        Jeevitha Manickam
        Jeevitha Manickam answered on Nov 4, 2014 10:50 AM

        Thanks Jose. It was very helpful.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Jeevitha Manickam
Favorites
0
Replies
6
Created On
Nov 04, 2014
Last Post
11 years, 4 months ago

Suggested Discussions

Created by

Created on

Nov 4, 2014 10:50 AM

Last activity on

Feb 23, 2026 4:45 PM