Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
710
Error delaring ClientEvents-Initialize event in WebDataGrid
posted

Hello! I am trying to call a javascript function that should receive the grid clientID by parameter in the initialize event of the grid. Here's my code:

 <ClientEvents Initialize=<%#"setLongTimeout('" + dgvLocResults.ClientID + "');"%> />

but I am getting

Databinding expressions are only supported on objects that have a DataBinding event. Infragistics.Web.UI.GridControls.GridClientEvents does not have a DataBinding event.

setLongTimeout is my function and exists, and dgvLocResults is the grid's name and exists as well.

What am I missing?

Thanks!

Parents
  • 18204
    Verified Answer
    Offline posted

    Hi Nicole Guivisdalsky,

    Thank you for posting in our forums!

    The reason you are receiving that error is because you are trying to use inline binding (<%# ... %>), which isn't available for the ClientEvents tag.

    Another issue here is that ClientEvents should be assigned to the name of a function, and not invoking a function.  Please try the following code for declaring the Initialize ClientEvent:

     <ClientEvents Initialize="dgvLocResults_Grid_Initialize" /> 

    And use this javascript code for the Initialize event's handler.

     function dgvLocResults_Grid_Initialize(sender, eventArgs)
    {
        //  sender.get_id() will return the grid's ClientID.
        setLongTimeout(sender.get_id());
    }

    If you need further assistance with this, please let me know and I will be glad to help.

Reply Children
No Data