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
315
How to set Textblock dynamically based on DataItem text
posted

I've xamdatagrid which is getting bind with ObservableBindingCollection.

I am showing the status which is coming from result set as below.

<Grid>

  <TextBlock Text="Status:" FontFamily="Microsoft Sans Serif" FontSize="8.25 pt"/>
            <TextBlock Margin="5,0,0,0" FontWeight="Bold" FontFamily="Microsoft Sans Serif"  FontSize="8.25 pt" Text="{Binding Path=DataItem.StatusText}" />

</Grid>

I want to modify  "Status:" based on the DataItem.StatusText.

E,g.

if  (DataItem.SatusText == "Pending") 

{

"Status:" should display as "Status  from Dev:"

}

Else

{

"Status:" should display as "Status from Prod:"

}

How to set Textblock dynamically based on DataItem text.

Parents Reply Children
No Data