This is a migrated thread and some comments may be shown as answers.

Filtering on IS NULL

1 Answer 105 Views
Grid
This is a migrated thread and some comments may be shown as answers.
RB
Top achievements
Rank 1
RB asked on 03 Nov 2014, 10:42 PM
I have a radgrid with a dropdown template for filtering. If there are null values, the dropdown displays a blank row.On click of this nothing happens. How can I catch this and display IS NULL?

void RadComboBoxControl_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
       {           
           string filterExpression;
           filterExpression = "([" + colname + "] ='" + e.Value + "')";
           if (e.Value.Equals("All"))
               filterExpression = " ";        
           radgrid.MasterTableView.FilterExpression = filterExpression;
           selectedValue = e.Value;
           radgrid.MasterTableView.Rebind();                   
       }
if (e.Value.Equals(""));
what should the filterExpression be so that all NULL rows are filtered.

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 06 Nov 2014, 01:05 PM
Hi Ruchi,

Please note that modifying the FilterExpression is quite tricky and it can be error-prone, therefore, it is not recommended. Instead, you can use the filter client-side method:
http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/filtering/filter-templates/defaultcs.aspx

In addition, I'm attaching a sample RadGrid web site to demonstrate a similar implementation with Null values.

Hope this helps.

Regards,
Eyup
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
RB
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or