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.
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. AgentD5 post an example of this on the following forum thread:http://www.infragistics.com/community/forums/t/24277.aspx
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.
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.
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.
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.
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. Here are some helpful links:Using Item Templates:http://help.infragistics.com/Doc/ASPNET/2013.1/CLR4.0/?page=WebDataGrid_Using_Item_Template.html
Reference a Cell when Creating an Item Templatehttp://help.infragistics.com/Doc/ASPNET/2013.1/CLR4.0/?page=WebDataGrid_Refrence_a_Cell_When_Creating_an_Item_Template.html
Please review the help topics I've linked above, the attached sample, and let me know if you have further questions.
Thanks Jose. It was very helpful.