Skip to content

Telerik RadGridView Filtering on Strings

August 7, 2009

The Telerik WinForms RadGridView control has proven to be very impressive to me thus far. Anything that automates and manages a large portion of the creation and functionality of your application is going to make decisions you don’t like but overall this one seems very good.

The Good:

I created a typed DataSet, complete with proper relationships between master/detail tables.
I then dropped a radGridView control on the form, set the datasourse as my dataset, the member as my ‘master’ table and then told it to AutoGenerateHierarchy. In those couple easy steps I created a triply-nested datagrid that admittedly wasn’t very pretty but it functioned as would be expected and was about 50% of what I needed out of the simple application request I received.

For the Good of the filters, it was very easy to create a filter following their example, and very easy to perform filtering based upon integer values. Also the filter/gridview are very responsive with small to moderate-sized datasets, but I’ve not tried anything large yet.

The Bad:

I created a filter and programatically placed it on one of the columns per their tutorial and was disturbed to find that using their EqualTo function, pasting the contents of a cell into the filter bar did not return any results. This means that the cell from which I took the value did not match itself. I did figure out what was happening (details here); basically their filter was stripping prepending spaces for comparison despite visually displaying them. This meant that pasting in ‘ 41’ would not match ‘ 41′ but rather ’41’.

The Fix:

Just strip prepending spaces in your query/dataset before putting it into the grid if possible. If you cannot, they have responded in the afore-mentioned and linked forum post that they may change the functionality in the future.

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: