What I need to do is set a GroupHeaderTemplate link to 1 of 2 URL's based upon the value of a GridBoundColumn.
If Section="Marketing" then display 1st URL
display 2nd URL
How would I go about doing this?
I attempted doing it on RadGrid.ItemDataBound but received an error because it didn't have a dataitem called "Section".
If DataBinder.Eval(e.Item.DataItem, "Section") = "Marketing" Then
4 Answers, 1 is accepted
I am not sure what value should be appended to the URL but you can use a conditional statement inside the GroupHeaderTemplate for achieving this. A possible realization of such an approach is available in the following code snippet:
The above code access the DataItem's Section value which should be available since you are grouping by that field.
If the suggested approach does not prove helpful please share with us the entire page contents(markup and code-behind) so we could examine the implementation.
That did help which I believe put me a bit closer to a solution. However I receive an error when attempting to run this code.
Additional information: DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'Section'.
The two URLS are:
/CUTracking/Notes/Default.aspx?Section=FMS&SearchCharterNum=<%# Eval("Charter_Num") %>"
The described behavior is expected as the data is not grouped by the Section field. Moreover inside the group the rows may contain different values for the Section column. From that point of view the targeted scenario does not seem correct. Can you please elaborate in detail on the functionality you want to implement?
Thank you as you helped me figure things out. I had to add section to my grouping and things began to fall into place.