I must say it or I will explode... Telerik's ASP.NET RadGrid sucks.
I know, and on IE <10 incredibly slow.
It is quite troublesome if you try to mix designer created columns and runtime added columns.
But no one uses the designer here.
In fact we derived from the RadGrid and added a second data source
(XDataSource) for the Columns. So you can bind Columns and their
sequence as well as the data rows.
However, we fixed the issue you mentioned on the way. If the XDataSource
contains a simple string with "@UniqueNameOfTheColumn", you can insert
columns defined in aspx wherever you like. If it does not contain this
string, the column is invisible.
It is true that provides some cool filtering capabilities,
That being said, RadGrid allows a couple of ways of tweaking the columns it provides at runtime. Maybe there are more choices, I know only two:
a) Create a new class and inherit from its columns.
b) Use its columns but use a custom template with the desired formatting logic. You should create a class that derived from ITemplate.
The most simple choice could be b), but cannot do any quick test/sample because I am on holiday and don't have access to my devel machine.
Our extension already provides a column factory, so b) is straight
forward. But normally it only creates BoundGridColumns (not sure with
the name).
In fact I have already implemented b) for type TimeSpan in the code for
older Framework 3.5 where TimeSpan.ToString() did nothing useful, except
for debugging. But once you go this way, you loose all the cool
features. Even sorting does no longer work. And the Telerik Column
classes are implemented in a way that you can neither reasonably extend
them nor add a new one.
Marcel