Click here to Skip to main content
15,889,877 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
In edit form, i need checkbox already checked if Active field value is 'true'. Currently it shows always unchecked for both values (true/false in Active)


C#
{ name: 'Active', index: 'Active', width: 150, align: 'center', editable: true, edittype: 'checkbox',
                    editoptions: { value: "true:false", defaultValue: "false" },
                    formatter: function (cellvalue, options, rowObject) {
                        if (cellvalue == 'true' || cellvalue == true)
                        { return "<img src='Images/active.png' style='width: 20px; height: 20px;' alt='Active'title='Active' />"; }
                        else
                        { return "<img src='Images/inactive.png' style='width: 20px; height: 20px;' alt='In Active'title='In Active' />"; }
                    }
                }


Thanks in advance.
Please help...Am I missing something...

Note: in grid i need images according too Active value (this working fine). But on edit the record Active field having checkbox having its value according to Active field (this not working).
Posted
Updated 27-Jul-12 19:30pm
v2
Comments
tanishtaman 28-Jul-12 2:48am    
plz...reply....
tanishtaman 28-Jul-12 3:20am    
help me plz....experts
tanishtaman 28-Jul-12 10:11am    
some body plz....help me
Sandeep Mewara 29-Jul-12 14:09pm    
When is the above jQuery code executing? While load of page?
tanishtaman 8-Aug-12 22:41pm    
yes on load

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900