Selection of check box based on data based on databased value

if a checkbox is to be displayed in a grid and it is to be checked in accordance with the column value that is on the table. How it is possible.

I used display method is does not allow to edit it.

public display boolean DisplayRequired1()
{
if(this.Seg_Req==‘M’)
{
return true;
}
else
{
return false;
}

That’s correct. Display methods are used to display calculated values, not to edit them. By the way, it could be written simply like this:

display boolean displayRequired1()
{
    return this.Seg_Req == 'M';
}

You could use an edit method, but if I was you, I would fix the data model. Storing business data as cryptic string values and hard-coding this business data in code is a bad idea. You should use an enum field instead; either a checkbox represending “display required” or an enum with multiple values corresponding to possible values of Seg_Req (then you’ll refer to the value by something like MyOptions::Required instead of 'M').

But will the checkbox be checked by this code?.

I want to simply show the checkbox checked when the value in one of the columns in my table, which has the values “M” and “O” stored in it. When value will 'M ’ checkbox should checked.

Sorry, it’s not clear to me what you’re referring to when asking “will the checkbox be checked by this code”?. Please elaborate.

display boolean displayRequired1()
{
return this.Seg_Req == ‘M’;
}
Can I use this code to do what I want by writing it into a table method and binding it to a data field that has a check box?

I Want checkbox will checked when my seg_req value is ‘M’

It’s your own code; I just simplified it. I thought you already tried it (and found that it works, just that you can use the display method to edit data).

Yes, it’ll show a checkbox checked if the value is ‘M’, but you won’t bind the checkbox to a field. You’ll bind it to a data method instead.

Okay, I will try it and let you know.

It functions, yes, but editing is not possible.
Can you please give me some solution for that?

Please see my first reply.