I store the name of the document in the a field in the database but I actually store the document in the filesystem. Is there a way to make a column that displays the icon of the type of file (i.e. PDF, DOC, DOCX) and when the user clicks on the icon it brings up the document in a new WPF window or page. How do I do this?
Thanks,
Linda Rawson
Hi Alex,
I hav a XamDataPresenter whcih bind some fields from Database. Now i want to Add Control in XamDataPresenter , for eg : For 4 Fields coming from Database i need 4 Template control i.e. two Hyperlink ,two textbox and these control should be bind with the Databse value.
Please provide the solution for the same.
Regards,
Satish
Linda,
You can use a style similar to this one to create a CellValuePresenter, which will display its content as a Hyperlink. You can assign this style to the CellValuePresenterStyle property of a specific field's settings:
<Style x:Key="CVPLinkStyle" TargetType="{x:Type igDP:CellValuePresenter}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
<TextBlock>
<Hyperlink RequestNavigate="Hyperlink_RequestNavigate" NavigateUri="{Binding Path=Value,
RelativeSource={RelativeSource TemplatedParent}}">
View News
</Hyperlink>
</TextBlock>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
I guess what I am asking more than anything is how do I put a hyperlink in the column?
Hello Linda, There is no built in functionality to achieve that now. First you can get the icon form file system file. You can look at this article showing how to get the icon of the file type.http://www.codeproject.com/KB/cs/GetFileTypeAndIcon.aspxRegarding the second requirement to open this file in a WPF window or other page, this also is not supported, because of the fact that every different file have different file format of storing the data in to a file system. So you open these files in default programs by :Process.Start(fileName);Let me know if that helps.Sincerely,DimiDeveloper Support EngineerInfragistics, Inc.