We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Serverside Events are not firing for TreeGrid

Hi Team,
I have attached a handler to server side event OnServerRowSelected. But the event is not firing. Do I need to set any property to make the event triggered.

Thanks,
Suresh.

4 Replies

KS Kadam, Suresh B. (WTIC 535) CWR July 17, 2017 06:37 AM UTC

Hi Team,

I even tried client side event RowSelected. It is also not firing. Please help me. I have configured the grid as it is given in the online samples.

http://asp.syncfusion.com/demos/web/treegrid/events.aspx

Your quick response will be highly appreciated.

Thanks,

Suresh.




JD Jayakumar Duraisamy Syncfusion Team July 17, 2017 02:54 PM UTC

Hi Suresh, 
We have analyzed reported issue in our sample but unable to reproduce it, please make sure that the ej.web.all.min & ej.web.form.min script files are referred properly in your project. 
And check rowSelected event handler function is added in proper script block. 
Hence, we have prepared a sample with working of both client & server side row selected event but we would like to suggest you that use client side row selected events because it is properly works in all the aspects. 
[aspx] 
<ej:TreeGrid ID="Treegrid" RowSelected="rowSelected" // Client side event  
//.. 
<%--  OnServerRowSelected="TreeGrid_ServerRowSelected" --%> 
 
Please find the sample location as below, 
Please let us know, if you require any other assistance. 
Regards, 
Jayakumar D 



KS Kadam, Suresh B. (WTIC 535) CWR July 18, 2017 08:38 AM UTC

Hi JayaKumar,

You are right. ej.web.form.min script was missing in our project. Adding this resolved the issue. Thank you.

Is there any example for TreeGrid reading data in the OnServerRowSelected event.

Regards,

Suresh Kadam.



JD Jayakumar Duraisamy Syncfusion Team July 19, 2017 12:52 PM UTC

Hi Suresh, 
Please find the response below. 
In OnServerRowSelected event will trigger with two arguments. The first argument has TreeGrid model and second argument have the selected record and index value. 
Please refer following code snippet, 
<ej:TreeGrid ID="Treegrid" OnServerRowSelected="TreeGrid_ServerRowSelected" 
//…  
protected void TreeGrid_ServerRowSelected(object model, TreeGridEventArgs eve) 
        { 
            //model have API with updated values 
            //eve have record index and selected record             
        } 
Note: In the model, we have only API values, we can’t get the record collections but client side rowSelected event we can get the updated record collections and other values. Later, we can pass it to the server side using Ajax post. 
We have also prepared a sample for your reference. Please find the sample location as below, 
Please let us know, if you require any other assistance. 
Regards, 
Jayakumar D 


Loader.
Live Chat Icon For mobile
Up arrow icon