model
public bool? IsActive { get; set; }
linq statement pseudo code
var userstatus = Users.Select(e => e.IsActive).Distinct().select();
if (userstatus(bool) is DBNull)
{
e.Item.Text = "inactive";
e.Item.Value = "0";
}
else if ((bool)["Bool"])
{
e.Item.Text = "active";
e.Item.Value = "1";
}
select it by dropdown list
<select >
<option value="">All</option>
<option id="active">Active</option>
<option id="inactive">InActive</option>
</select>
filtering
if($("#active").val()){
$filter.push({ field: "IsActive", operator: "eq", value: true });
}
if($("#inactive").val()){
$filter.push({ field: "IsActive", operator: "eq", value: false });
}
so the linq is wrong and also the filtering, any one can help me or done this before
I want to filter the column by the user status is active or not
For the filtering change your logic like this