Hi,
How can we add an hyperlink on the summaries. Hyperlink on cells are acheived using CellValuePresenter, but that property doesn't seem to be available for summary cells. How can we add an hyperlink on the summary?
Thanks, Naveen
Hello Naveen,
This can be accomplished by re-templating the SummaryResultPresenter. You can see an example of this in the sample that I have attached.
By default the SummaryResult.DisplayTextAsync. To get this look where just the Value is a hyperlink you have to use a StackPanel containing multiple TextBlocks. The first should be bound to the name of the Calculator used, the second should be the equal sign or whatever separator you want, and the third will display the SummaryResult.ValueAsync as a hyperlink.
Please let me know if you have any further questions or concerns about this matter.
Hi Jason,
Thanks a lot, I am able to create an hyperlink on the summary fields,
We have more than 1 summary fields, how can I know which hyperlink the user has clicked, because based on the user selected hyperlink, the data has to be displayed. So whenever a user clicks an hyperlink and event is raised that will call the command on the viewmodel.
Hi Jason, How can I know which column grand total did the user click? because we can have more than 1 hyperlink.
There are several ways you could accomplish this, though one of the easiest approaches would probably be to set up a binding on the Hyperlink's tag. Then, in the click event extract that information from the Tag and use it as you need. For example, here's what it would look like if you wanted the Field's name:
<Hyperlink NavigateUri="http://es.infragistics.com" Tag="{Binding Path=SummaryResult.SourceField.Name, RelativeSource={RelativeSource TemplatedParent}}" Click="Hyperlink_Click">
<TextBlock Text="{Binding Path=SummaryResult.ValueAsync, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"/>
</Hyperlink>
If you wanted access to the whole field or the whole SummaryResult then you could shorten the Path as needed.
Hey Jason,
Thanks a lot. Its working.
Naveen :-)
Great to know Naveen. Glad I could help :)