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
1564
How to display different content based on a condition ?
posted

 Hi,

 In a xamDataGrid I would like to put several kind of items :

class MyFile { ... }

class MyFolder { ... }

I would like to have a column that display a "icon path" representing a folder if it is a folder, and a  "icon path" representing a file if it is a file.

Something like this (the text in Bold is to show you an exampl)

<Path x:Key="iconFolder/>
<Path x:Key="iconFile/>

 <igDP:UnboundField Name="Title">
     <igDP:Field.Settings>
        <igDP:FieldSettings CellWidth="160" AllowEdit="False">
            <igDP:Condition Condition="ItemClass is MyFile" Action="Content=iconFolder"/>
            <igDP:Condition Condition="ItemClass is MyFolder" Action="Content=iconFile"/>

        </igDP:FieldSettings>
     </igDP:Field.Settings>
 </igDP:Field>