CallBack in GridView  
Author Message
Bilal Haidar - MVP





PostPosted: Windows Forms Data Controls and Databinding, CallBack in GridView Top

Hello:

I am in the process of extending GridView and adding some functionalities.

For example, I added a single row click to postback and handle the event. I would like now to be able to do a CallBack instead of PostBack.

Do you know if there is a whitepaper on how that CallBack functionality is added to the Grid currently through sorting and paging I believe it is better to follow the same technique used.

I have been trying for some time, im getting all the needed methods and functions, and I have added for example:

Grid1.EditIndex = e.GridViewRow.RowIndex;

inside the handler of the sinlge click which is being fired upon a callback, I am doing debugging and I am going to that method, but nothing is changing on the grid.

Any ideas

Thank you.



Windows Forms28  
 
 
Sarah Parra - MSFT





PostPosted: Windows Forms Data Controls and Databinding, CallBack in GridView Top

I think you will have better luck posting this in the ASP.NET forums. They have a forum specifically for Data Presentation Controls, including the GridView: http://forums.asp.net/24/ShowForum.aspx.

Thanks,
Sarah



 
 
Bilal Haidar - MVP





PostPosted: Windows Forms Data Controls and Databinding, CallBack in GridView Top

Hello Sarah:

Thanks for your reply. I am a moderator and top poster at the forums .

I didn't get any reply there!!

Thanks a lot.


 
 
Sarah Parra - MSFT





PostPosted: Windows Forms Data Controls and Databinding, CallBack in GridView Top

Ah, I see. Well, maybe someone here will have some experience with the control and can help. It's definitely not me though. :)

 
 
Badri Narayanan





PostPosted: Windows Forms Data Controls and Databinding, CallBack in GridView Top

Hi Bil,

ASP.NET 2.0 introduces new script callback for no-postback functionalities (AJAX).

I understood the basics from Dino Espositos articles from here...
http://msdn.microsoft.com/msdnmag/issues/05/01/CuttingEdge/default.aspx
http://msdn.microsoft.com/msdnmag/issues/04/08/CuttingEdge/

Note: the ICallbackEventHandler interface has changed in the RTM release of 2.0 framework though its not much change.

As far GridView's sorting and paging is concerned, it implements the same ICallbackEventHandler interface. When paging is performed, a callback is made that gets handled by the GridView control. Based on the arguments sent (received in the RaiseCallbackEvent), GridView prepares HTML output and returns it back to the client. At the client-side, the Gridview simply replaces the HTML.

The above is what I understood from the basics of ASP.NET 2.0 CallBack event handler and the working of Grid by using Fiddler (
http://www.fiddlertool.com/fiddler/)

Dino has an excellent article on Extending GridView here...

http://msdn.microsoft.com/msdnmag/issues/06/05/CuttingEdge/

HTH

Cheers,


 
 
Bilal Haidar - MVP





PostPosted: Windows Forms Data Controls and Databinding, CallBack in GridView Top

Hello:

Thanks a lot for the detailed reply. I will look at all the links you provided.

In fact, I was debugging yesterday and I found out that the CallBack is working fine.

But the problem is I need to refresh the Grid. So I have to override the Render method, I should provide some code in the client function to refill the Grid with the update state.

But I found a small conflict here, when you enable Paging and Sorting CallBack, the Grid will be displayed in a "div", so you would do something as document.getElementById('_div") = result;

So, I shall only check, if the PageAndSortCallBack is false, I should wrap the Grid within the "div" to be able to refresh it, else the div will be present. I figured out that around 1:00 am, so I will be working on that, no idea on how to wrap a grid in such a div, but I will work on it.

I will post the code soon once it works, maybe you might be interested.

Sara, thanks a lot for your kindness. Replying to me is much appreciate from your side.

Have a nice day all of you!

Bilal.


 
 
Bilal Haidar - MVP





PostPosted: Windows Forms Data Controls and Databinding, CallBack in GridView Top

Hello Badri:

I tried to use the Fiddler, didn't get well how it can help.

What I reached up till now is that, when I double click on the row, I have the Row in Edit State. But when I click on Update, it simply posts back, then I had to click again to submit the update.

As if, when it was first placed in Edit Mode, the HTML was not updated!!!

Is there a way I can send you the code to test

Thanks a lot.

Bilal.


 
 
Badri Narayanan





PostPosted: Windows Forms Data Controls and Databinding, CallBack in GridView Top

Hi Bil,

My personal id is pbadrinarayanan at gmail. You may send your code. I would also need to know what exactly you want to do (the functionality). That would help me go through the code with a prior understanding. In case you are interested, i can suggest few features that I would love to have which you may consider for your extension.


 
 
Badri Narayanan





PostPosted: Windows Forms Data Controls and Databinding, CallBack in GridView Top

Hey, check this one ->

http://weblogs.asp.net/scottgu/archive/2005/12/26/433997.aspx

Another way of extending grid with Atlas.


 
 
Parimal





PostPosted: Windows Forms Data Controls and Databinding, CallBack in GridView Top

Hi Bilal,

Thanks in Advance.

Parimal


 
 
Bilal Haidar - MVP





PostPosted: Windows Forms Data Controls and Databinding, CallBack in GridView Top

Hello:

Please download the code from the CodePlex here:

http://www.codeplex.com/Release/ProjectReleases.aspx ProjectName=xgrid

Regards