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
705
how to properly use Column.Style.URL
posted

I have a grid in a C# winform app that when I initialize it, I set the property of a column to this:

e.Layout.Bands[0].Columns["MyURL"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.URL;

Now I've read where whatever is the cell content for that cell will be given a URL styling so I assume I need to form the link before the row is painted since I am taking cell data and appending it to this link (in a querystring).

I was trying the InitializeRow event with this code but it hasn't been working. 

string

 

myId = e.Row.Cells["MyURL"].Value.ToString();

e.Row.Cells[

"MyURL"].Value = http://mywebsite.com/test.asp?id= + myId;

Do I need to use a different event here?

 

Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    The InitializeRow seems like an excellent place to do this.

    What's not working?

    One odd thing I notice about your code is that you are reading from the same cell you are writing to. So this isn't going to work, because the second time the InitializeRow event fires, you will end up building the string using the entire string as the ID.

Children