This question is locked. New answers and comments are not allowed.
Hello,
I use the Grid to display datas, some of them are "boolean". i would like to display an "OK" icon only if the value of the column is "TRUE". If it is "FALSE", i don' t display anything. How can I do that ?
Here is a first test
But it always displays an image, because I can't have the value of the property name, only the type...
Thanks !!
I use the Grid to display datas, some of them are "boolean". i would like to display an "OK" icon only if the value of the column is "TRUE". If it is "FALSE", i don' t display anything. How can I do that ?
...........Columns(c =>{c.Bound("My boolean property").ClientTemplate(/* an image if is it TRUE, nothing if FALSE */)
}
Here is a first test
private string GetItem<T>(string propertyName)
{
Type t = /* Here is the type of my property (external method); */
// if bool, display an image only if the value is TRUE
if (t == typeof(bool)){
// TODO : display an image only if TRUE, nothing if FALSE
if(*/myValue*/)
{
// mHelper is HtlmHelper type
return mHelper.Image(/Images/true.png"); } // if not, display the value of the property return string.Format("<#={0}#>", propertyName); }But it always displays an image, because I can't have the value of the property name, only the type...
Thanks !!