I am adding a row to a grid in javascript as follows
var row = new Array(est, "", "", AddBlankLines(5), false, "<%=Master.UserName%>", "");
rows.add(row);
var lastRow = rows.get_row(rowsLength);
lastRow.get_cellByColumnKey("loge_summary").set_value(false);
DebugOut("val after set [" + lastRow.get_cellByColumnKey("loge_summary").get_value()+"]");
This returns false
When the row in the grid is displayed, the 5th column checkbox is checked ?
I cant figure it out and it is driving me crazy. lol.
Any ideas ?
Markup
<Columns> <ig:BoundDataField DataFieldName="loge_time" DataType="System.String" Key="loge_time" DataFormatString="{0:MM/dd/yyyy h:mm}" Width="100px" CssClass="igg_top" > <Header Text="Time"/> </ig:BoundDataField> <ig:BoundDataField DataFieldName="loge_111" DataType="System.String" Key="loge_111 " Width="70px" CssClass="igg_center" >
<Header Text="111" CssClass="igg_center" /> </ig:BoundDataField>
<ig:BoundDataField DataFieldName="111_description" DataType="System.String" Key="111_description" Width="160px" HtmlEncode="False" CssClass="igg_top" > <Header Text="System" /> </ig:BoundDataField>
<ig:BoundDataField DataFieldName="loge_text" Key="loge_text" EnableMultiline="True" HtmlEncode="False" DataType="System.String" CssClass="igg_top" > <Header Text="Text"/> </ig:BoundDataField> <ig:BoundCheckBoxField DataFieldName="loge_summary" Key="loge_summary" Width="50px" DataType="System.Boolean" CssClass="igg_center" ToolTipPartial="Unchecked" > <Header Text="Sumry" CssClass="igg_center"/> </ig:BoundCheckBoxField> <ig:BoundDataField DataFieldName="user_id" DataType="System.String" Key="user_id" Width="80px" CssClass="igg_top" > <Header Text="User"/> </ig:BoundDataField> <ig:BoundDataField DataFieldName="key" DataType="System.String" Key="key" Width="80px" Hidden="true"/> <ig:TemplateDataField Key="log_delete" Width="30px" CssClass="igg_center"> <Header Text="" /> <ItemTemplate> <a href="javascript:deleteRow()"><img src="img/delete.png" /></a> </ItemTemplate> </ig:TemplateDataField> <ig:TemplateDataField Key="log_copy" Width="30px" CssClass="igg_center"> <Header Text="" /> <ItemTemplate> <a href="javascript:copyLogText('c')"><img src="img/copy.png" /></a> </ItemTemplate> </ig:TemplateDataField>
</Columns>
i should add that i am using a CharConverter as the database uses Y and N for values
Hello Peter,
I believe that you are having a similar issue as the one mentioned in the following forum thread:
https://www.infragistics.com/community/forums/f/ultimate-ui-for-asp-net-web-forms/71303/checkbox-field-in-webdatagrid
To sum it up, what you would need to do is setting the DataType property of the field to character instead of bool, and then set the ValueConverter property for that column, this would ensure that the values is saved as a character i.e “y/n” and the checkbox would show the corresponding value.
There is an example of converter in this post I shared above, you would only need to change the type from int to char and 0/1 to n/y.
If this doesn’t resolve your issue, could you please send an isolated sample that reproduces it?
Regards, Ivan Kitanov