c# - Return updated POCO object attached to GridView control using Reflection -


I have custom grid view control from the ASP GridView control. Now I am using my custom grid view control.

I attach a list object to this custom grid datasource, and store this list in the viewstate so that whenever the grid works anytime, I can manipulate this object. Postback

Now every time I do the entry, updating and removal work, I have to manually write the code for data manipulation in all my forms. I.e. retrieve data from the viewstate and then update the data or delete the data or insert the data into that object and store it again in the viewstate.

I take care of this task once in a single place in my custom grid view class object, able to update, insert and delete all the forms of my custom grid view control without any code writing form. should be there.

Finally, in order to save the data in constant repository, I should get the last POCO object from custom grid view control.

It can be achieved with reflection but how?

Can you please tell me how can I get this work? Or what would be the best way I should follow?

Thanks, Huzayfa

I ask whether the visual state has its underlying Whether or not it is the best practice to store a data source. Have you considered putting this list in session? It will be easy to access and you will not burden your users on the inflated page sizes due to the overweight viewstate.

If you need to go with your stated approach, can you put the code in the base instead of trying to dig it into Gridview? In this way you only have to type the code, but it is more appropriate to try to hack the gridview yourself.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -