Home All Groups Group Topic Archive Search About

CallBack and Form Problem...

Author
13 Jan 2006 12:57 PM
Rothariger
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.RaiseCallbackEvent
        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!

Author
13 Jan 2006 1:08 PM
Rothariger
if you enter to the address i give, i added 2 buttons more, to gridview, so
you could view working...

but if you touch first the gridview buttons the others dont work at once...
and if you touch the infragrid buttons the first time, and then gridview
doesnt work neither...


it was clear?

thanks!
Author
13 Jan 2006 1:28 PM
Rothariger
i add something, with firefox, it works like i want...

AddThis Social Bookmark Button