Can i use the ajax to update Grid without refreshing page?


#1

or using RenderControl to get the output HTML code ?

my code is :
System.IO.TextWriter stringWriter = new System.IO.StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(stringWriter);
Grid.RenderControl(htw);
htw.Flush();

return stringWriter.ToString();

but it returned only the first line of Grid.


#2

Hi,

This control does not support AJAX by far. And we are researching this technology.

Why do you want to get the output HTML code? Please tell us your need to let us know how to help you.

Thank you.


#3

i just want to reload the Grid in case of changing the criteras. for example, when the DropDownList SelectedValue changed, i want to reload the Grid with the new data but without reloading all of this page.
so i implemented the interface System.Web.UI.ICallbackEventHandler to try to get the new Grid HTML Code in callback function, then i can replace the old HTML code by the new code, but it only returned one line.


#4

Hi,

There is not a simple way to get the HTML. To do that, you have to write a derived class from GridWeb, create a new method, calling the OnInit, OnPreRender, and get the HTML with calling the render method.


#5

ok, thank you anyway.