Hello, im testing to make a webapplication, that has 2 buttons and with this
buttons you could change the databinding of a webgrid... i have a problem,
that the first time it renders 100% ok, but at the second time it throws an
error of object not initialized. here is my code... i need to make it to the
form because of the grid. with the gridview of .net works fine, but i want to
make it with the infragistics grid!
here is the test. http://rothariger.com.ar/icallback/icallback.aspx
<[Server Side Code]>
str: is a variable private to the form.
infragrid: is a variable public global of type infragistics ultrawebgrid i
save this for save the style.
uwg: is the grid of the form.
the error occurs in this line Form.RenderControl(htm).
Public Function GetCallbackResult() As String Implements
ICallbackEventHandler.GetCallbackResult
Return str.ToString()
End Function
Public Sub ReiseCallbackEvent(ByVal eventArgument As String) Implements
System.Web.UI.ICallbackEventHandler.RaiseCallbackE vent
uwg = infragrid
uwg.Visible = True
Select Case eventArgument
Case "Button1"
uwg.DataSource = Usuarios()
uwg.DataMember = "Usuarios"
uwg.DataBind()
Case "Button2"
uwg.DataSource = Room()
uwg.DataMember = "Rooms"
uwg.DataBind()
End Select
Dim sr As New IO.StringWriter()
Dim htm As New HtmlTextWriter(sr)
Form.Controls.Add(uwg)
Form.RenderControl(htm)
str = sr.ToString()
End Sub
<[Client Side Code]>
myBody: is the body, so i change all innerhtml in the body.
function myFunction(args, context)
{
grid = document.getElementById("myBody");
grid.innerHTML = args;
}
thanks for any help!