Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
355
Provide hyperlink columns (cells) in a WinGrid that display "Click here"
posted

I would like a WinGrid (in NA 2009.1) to have one or more hyperlink columns that display "Click here" (with no editing).  Upon clicking on the cell, I need to navigate to a URL.

What is the recommended method for doing this, including the recommended method for storing (and stuffing) the URL for the cell.

Thanks,

Tom K.

Parents
  • 469350
    Verified Answer
    Offline posted

    Hi Tom,

    You can set the Style on the Column to Formatted and populate it with some xml to provide a link.


            private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
            {        
                UltraGridColumn myURLColumn = e.Layout.Bands[0].Columns.Add("My URL Column");
                myURLColumn.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.FormattedText;

            }            

            private void ultraGrid1_InitializeRow(object sender, InitializeRowEventArgs e)
            {
                if (e.Row.Band.Index == 0)
                {
                    if (e.Row.Cells.Exists("My URL Column"))
                    {
                        e.Row.Cells["My URL Column"].Value = "<a title=\"Click here to go to Infragistics web site.\" href=\"http://www.Infragistics.com\">Click here</a>";
                    }
                }
            }

Reply Children