Currently my Grid shows True, False, or N/A in the cell for boolean values. What would be the way so that I can get it to show Yes, No, or blank? The users are somehow getting confused by True/False/NA.
I'm populating the Grid using a SQLDataSource tied to a stored procedure in a 2005 SQLServer database. Also, I am using a RowEditTemplate where the value is tied to a radiobutton group.
Thanks,
Will
Hristo, Thanks for your help with this issue. I definitely understood what you were going for, but I was trying to do it without having a radiobutton in the column. I finally stumbled upon using the actual cell text to trigger off of instead of the value of the cell to handling the checking of the radiobuttons in the RowEditTemplate. Now it works perfectly, and the grid column shows Yes, No, or blank instead of True, False, or blank.
var cell = row.getCell(36); var cell_text = cell.getElement().innerText.trim();
if(cell_text=='Yes') {rbOpsYes.checked=true;} else if(cell_text=='No') {rbOpsNo.checked=true;} else {rbOpsYes.checked=false; rbOpsNo.checked=false;}
Will,
I modified your files but I couldn't run it because there is no database. Please test it and tell me what is the result.
Thank you
OK, here are the files for this page. Thanks for the help!
It would be nice if you post your source code.
Thanks
Hristo,
Thanks for your help! I didn't even think of using Eval. I changed mine to a label as I'm using a RowEditTemplate to edit the rows.
There's now an issue doing it this way. It's passing true as the value if the label is null so the Yes radio button in the RET is getting checked even though the value is null (not true or false). Below is some snippets. If it would help to get the full code, let me know and I'll attach
<igtbl:TemplatedColumn BaseColumnName="input_ops" IsBound="True" Key="input_ops">
<CellStyle HorizontalAlign="center"></CellStyle>
<HeaderStyle HorizontalAlign="center" />
<CellTemplate>
<asp:Label ID="lbl_ops" Width="40px" runat="server" Text='<%# GetValue(Eval("input_ops").ToString)%>' ></asp:Label>
</CellTemplate>
<Header Caption="OpsInfo?">
<RowLayoutColumnInfo OriginX="36" />
</Header>
<Footer>
</Footer>
</igtbl:TemplatedColumn>
//In uwg_BeforeRowTemplateOpen. row.getCell(36).getValue() is returning true even though the database value is null.