Fluent Grid conditional column content #704
-
Hello, I'm using a FluentGrid like this:
This is working fine. But how can i display column content based on a contidion? I've tried that. But it is not working:
I hope someone can help me... Best Regards |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
There is an example for this in the demo site: https://www.fluentui-blazor.net/DataGrid#dynamiccolumns. Razor code of that look suspiciously lot like yours though...I guess it is not working because of making it a code blok. Try it with the You could also do with one column and use the
Where state icon is a variable sot to either |
Beta Was this translation helpful? Give feedback.
Ah, I didn't notice the use of
context
...What if you move the condition inside the<TemplateColumn>
, i.e.:I' think
context
will then be of typeTGridItem
but not sure. Maybe you need to navigate up in your class /data model (ie something likecontext.Row...
)For second part. if you need to know data from the actual item that is not going to work I think. Like I sad, I did not notice the 'context' use