Get grid id from databound event

Hi, how can retrieve the "id" of the grid control via the "dataBound" event? I have three grid controls on the same page.

I need it to retrieve the grid data by "DataSource" to return to the Razor page model in the post.

Thank you,
Masssimo



3 Replies

SK Sujith Kumar Rajkumar Syncfusion Team December 10, 2021 06:48 AM UTC

Hi Massimo, 
 
Greetings from Syncfusion support. 
 
Based on the query we would like to let you know that the current Grid instance can be retrieved in its dataBound event from ‘this’ keyword. So here you can get the current Grid id from this instance as demonstrated in the below code snippet, 
 
// Grid’s dataBound event handler 
function dataBound() { 
    var gridId = this.element.id; 
} 
 
Please get back to us if you require any further assistance. 
 
Regards, 
Sujith R 



MA Massimo December 11, 2021 12:29 AM UTC

Hi, it works.

Thanks for the support.

Regards,
Massimo



SK Sujith Kumar Rajkumar Syncfusion Team December 13, 2021 05:40 AM UTC

Hi Massimo, 
 
You’re welcome. We are glad to hear that your query has been resolved. 
 
Regards, 
Sujith R 


Loader.
Up arrow icon