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
160
Having an Embedded checkbox and display Y/N within a grid.
posted

Hi All,

 

I have a wingrid within my application, one column of which has its style set as a checkbox.

The exact scenario for the checkbox is as follows:

   1. The grid has a column for which the style is set as a checkbox.

   2. When the form loads the cell should display N.

   3. When we click on the cell the checkbox is displayed. On checking and tabbing out Y should be displayed.

       On unchecking and tabbing out N should be displayed.

 

I have made use of a datafilter class to achieve the same but the problem is that when the form loads control does not come to the datafilter class, ie i have no control over the first value which is shown on the cell. Once i click on the cell and then tabout it seems to work perfectly. Could you please let me know how i can alter the value being displayed on the cell, when the grid is loading for the first time?

 

For reference i have attached a sample isolated application having the problem. I have a column "Check" which is of type string and has its style as checkbox.

I have hardcoded true or false values for the column Check. This is because in the actual application the values come from the server and I cant change it. I have attached a datafilter to change the checkbox to return values Y or N. The problem arises when the grid loads, it displays values true or false. I want to know if there is any way at which I can have the grid display Y or N based on whether the value is true or false as soon as the grid loads. I also cant do any kind of hard coding in the form load event because the value actually comes from the server.

 

Thanks in advance.

Prenil

Checkbox within a grid.zip