This is a migrated thread and some comments may be shown as answers.

[Solved] Conditional DynamicHyperlink Column

3 Answers 101 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
John
Top achievements
Rank 1
John asked on 28 Oct 2010, 03:43 PM
Hi there,

I am wondering if it is possible to use the DynamicHyperlinkColumn in such a way that a flag can be set indicating whether or not the text displayed in the field should actually be a hyperlink or just static text.

For some context - I am implementing a grid view to display the daily status of a number of items.  Each of these items contains a reference to a file. If that reference (defined as an int?) is null, then the file has not been processed for the current day and I want the text in the Dynamic Hyperlink Column to display as static text, not a link.  In the case that the reference is not null, I would like the hyperlink to be displayed.

I have no problem with setting the backend hyperlink portions of the cell, just with getting the text to display as static.


Thanks,

John

3 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 28 Oct 2010, 04:00 PM
Hi John,
I will suggest a bit different approach .  You may use a regular column, instead of hyperlink column.
Then you will need to provide two separate DataTemplates to be usedfor the cell - one with hyperlink and one with a plain text.

The conditional switching between these two templates may be achieved by a the approach demonstrated in this online example.

In case you find troubles implementing this, do not hesitate to contact us.

Best wishes,
Pavel Pavlov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
John
Top achievements
Rank 1
answered on 28 Oct 2010, 05:07 PM
Thanks for the idea.  I did read through the code, I only had one question where the demo code is concerned - where is the condtion converter defined - I did not see it in either the backend or defined on the page.

Thanks,

John
0
Vlad
Telerik team
answered on 29 Oct 2010, 07:01 AM
Hi John,

 Please download our demos to check this. The converter is not in the demo folder and that is why our code viewer cannot display it.

All the best,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
John
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
John
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or