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

Static Reflection

2 Answers 55 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 10 Mar 2009, 09:00 PM
All,

I realize that this is more of a request than a bug, but I consider anything using strings to do reflection as a bug. It is bad, bad, bad...especially when we have such things as Static Reflection available to us in 3.5 with Expression<T>.  The reason is that you don't get any compile time checking. Instead, you don't find out that you mispelled something or a property has been deprecated until run time when you finally click on that page where the grid lives.

Anyways, I am wondering what the plan is to change your columns to use Static Reflection versus using strings as DataFields. The reason that I ask this, besides it really bugging me, is that I am working on an implementation of our own bound column that uses it. Since I can't override its functionality as easy as you, especially because of all the internal calls, I will request that you make your grid columns start using Static Reflection. In case you don't know what this is, instead of mapping an object to a string representation of the property, you can actually map it to a compiled version of it using lambda. Below is an example of what I would love to see. A Fluent Interface would be my next request.

 

var amphireGridBoundColumn = new AmphireGridBoundColumn<Product>().MapDataField(x => x.CasePrice);

 

amphireGridBoundColumn.HeaderText =

 

"Case Price";

 

radGrid.MasterTableView.Columns.Add(amphireGridBoundColumn);

Thanks for taking the time to read this and I hope that you can implement it soon.

Mike

 

 

2 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 13 Mar 2009, 02:49 PM
Hello Mike,

Actually we are already researching in this direction for switching to complied Expression Trees for column value retrieval for our Net 3.5 version of the control. As you may know our Net 3.5 RadGrid is already using LinqToObject for internal data manipulations.

Thank for your suggestion.

Sincerely yours,
Rosen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Mike
Top achievements
Rank 1
answered on 13 Mar 2009, 09:43 PM
Thanks. We are looking forward to it.

Mike
Tags
Grid
Asked by
Mike
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Mike
Top achievements
Rank 1
Share this question
or