I was able to get part of my answer from another question but cannot find a more specific bit of information that I need to finish.
I am trying to combine 2 fields into 1 like the above question but one of them is a GridHyperLinkColumn. I am using a GridItemDataBound event in the code behind to put 2 fields together like this:
protected void GridItemDataBound(object sender, GridItemEventArgs e) {
if (e.Item is GridDataItem) {
GridDataItem item = (GridDataItem)e.Item;
item["A"].Text = item["A"].Text + " /<br/>" + item["B"].Text;
item["C"].Text = item["C"].Text + " /<br/>" + item["D"].Text;
}
}
My UI shorten down for simplicity looks like this:
<Columns>
<telerik:GridBoundColumn UniqueName="A" DataField="A" />
<telerik:GridBoundColumn UniqueName="B" DataField="B" Visible="false" />
<telerik:GridHyperLinkColumn DataNavigateUrlFields="ID" DataNavigateUrlFormatString="~.aspx?ID={0}" DataTextField="C" Text="{0}" UniqueName="C" />
<telerik:GridBoundColumn UniqueName="D" DataField="D" Visible="false" />
</Columns>
This works well for the first 2 columns that I combine into 1 (A & B).
However suppose item["C"] is a GridHyperLinkColumn. When I try the same code, it only shows / <D value>
. Nothing shows up in front of the slash where "C" should be showing.
Is there a different property (instead of .Text) I should use or do I need to do it a different way?