Convert int to bool while binding
-
Hi, i have a table with an INT column. The value is either 0 or 1. (It is a flag). Now i'd like to bind it to an checkbox. 1 for checked. 0 for unchecked. I tried this: But i get an exception. How do i get this checkbox checked? (The update is no problem, i can convert the bool i get) Thank you.
-
Hi, i have a table with an INT column. The value is either 0 or 1. (It is a flag). Now i'd like to bind it to an checkbox. 1 for checked. 0 for unchecked. I tried this: But i get an exception. How do i get this checkbox checked? (The update is no problem, i can convert the bool i get) Thank you.
Try to do it on DataBinding event of Check box. Hopefully it will work.
Naveed Kamboh Complexity kills, Write easy code for your self. isolutionteam
-
Hi, i have a table with an INT column. The value is either 0 or 1. (It is a flag). Now i'd like to bind it to an checkbox. 1 for checked. 0 for unchecked. I tried this: But i get an exception. How do i get this checkbox checked? (The update is no problem, i can convert the bool i get) Thank you.
-
if it return only 0 and 1 then u can use the bool.parse() method,it will convert the value to bool, please check that