Hi,
I have a igGrid with a nullable boolean (bool? in C#) in a column. When the value is "null", the field shows "false". And if I try to filter for "null" value the grid no return rows (if I filter with false, the grid shows the rows with "null" values in the nullable bool column).
Thank you!
Hello Sergio,
Thank you for posting in our community.
What I can suggest is setting localScehaTransform option to false. If set to false, the data to which the grid is bound will be used "as is" with no additional transformation, which I believe is the reason why null values are converted to false. For example:
$("#grid").igGrid({ dataSource: data, autoGenerateColumns: false, dataType: "JSON", width: "97%", responseDataKey: "results", primaryKey: "Id", localSchemaTransform : false, autoCommit: true, columns: [ { headerText: "BrandCode", key: "BrandCode", dataType: "string", hidden: false }, { headerText: "Brand", key: "BrandName", dataType: "string", hidden: false }, { headerText: "Is Active", key: "IsActive", dataType: "bool" } ], features: [ { name: "Filtering", type: "local", showNullConditions : true, columnSettings: [ { columnKey: "Stage", allowFiltering: false }, { columnKey: "Save", allowFiltering: false } ] } ], });
Attached you will find a small sample where I have a record with null value and when the grid is filtered by null the record is correctly displayed in the results.
Please have a look at this sample and let me know if you need any further assistance with this matter.
igGridNullValues.zip
Hi Vasya,
When the grid is filtered by "false" the grid shows the "null" record.
What do implications have "localSchemaTransform: false"?