Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
445
How to display multiple row data from a detailed table in a single column.
posted

I currently have a xamDataGrid that displays rows related to messaging (text/email) between 2 people, basically a conversation history.  Currently I also display a column that shows an image if the message had an attachment.  For instance if a Word doc was attached to the message then the user would see a Word icon in the column indicating that a doc was sent with them essage, they can click the icon and view the doc that was sent.  The limitation right now is that the sytem will only allow 1 attached per message, the attachment is stored in the tMessageTransaction table as a binary and a related column that srtoed the file extension.  The file extension is used in the converter template to know which icon to display based on the file type.  All this works great.

Now I want to move the storage of the attachments to a details table so that a message can have multiple attachments.  What I'm looking for help with is how to modify the xamDataGrid to account for this.

Here's the current xaml snippet related to the Attachment column,

<igDP:Field Name="FileExtension" Label="">
<igDP:Field.Settings>

<igDP:FieldSettings>

<igDP:FieldSettings.CellValuePresenterStyle>

<Style TargetType="{x:Type igDP:CellValuePresenter}">

<Setter Property="ContentTemplate">

<Setter.Value>

<DataTemplate>

<Image ToolTip="View attachment" Cursor="Hand" Width="23" PreviewMouseLeftButtonDown="Image_PreviewMouseLeftButtonDown" 
IsEnabled="{Binding RelativeSource={RelativeSource AncestorType={x:Type igDP:CellValuePresenter}},Path=Value}"
Source="{Binding RelativeSource={RelativeSource AncestorType={x:Type igDP:CellValuePresenter}},Path=Value,Converter={StaticResource converter}}">

</Image>

</DataTemplate>

</Setter.Value>

</Setter>

</Style>

</igDP:FieldSettings.CellValuePresenterStyle>

</igDP:FieldSettings>  

</igDP:Field.Settings>

</igDP:Field>

 

The data is loaded based on a dataset, so this would also have to be modified to include the detail rows from the new table of multiple attachments.

I'm not sure how to go about doing this and would appreciate any guidance someone can offer.

Thanks

Troy