c# - Telerik RadGrid Binding Assuming Wrong Object Type -


we using radgrid control retrieve user objects repository uses nhibernate retrieve objects. using object data source defined as:

<asp:objectdatasource id="usersdata" runat="server" selectmethod="getall" dataobjecttypename="testingapp.lib.domain.user" typename="testingapp.lib.repositories.userrepository"> </asp:objectdatasource> 

the method signature getall follows:

public ienumerable<user> getall(); 

with nhibernate, users adminusers extends user. seems repository returning adminuser object first, , control seems assuming rest of objects adminuser rather user. causes following exception thrown:

"unable cast object of type 'testingapp.lib.domain.user' type 'testingapp.lib.domain.adminuser'." 

is there way force control assume data bound objects user rather adminuser? thanks!


follow-up

it appears radgrid used nhibernate in way not compatible , not work. have decided roll our own solution instead.

play magic property mastertableview.retrievedatatypefromfirstitem see if helps. think should set false in case or if set true, first item in collection should of type user (provided adminuser extends user class).


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -