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?
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.
Hmmm, I'm confused on what to do then. I need to treat the value coming out of the database as a querystring item. I don't really want to alter my SQL call to create the necessary URL for the grid to use as it's value. Isn't there a way to take the database field value and wrap all that HTML around it then have that be the URL value for the link?