Is any way to hide grid if datasource is empty?
Hello gerasha2,
I recommend you using the approach suggested by Angel Todorov in the forum post below:
https://es.infragistics.com/community/forums/f/ignite-ui-for-javascript/68274/grid---no-items-text/346033#346033
You can choose headerRendering event because it is raised earlier (thus you can avoid rendering the grid before hiding it)
https://www.igniteui.com/help/notfound?aspxerrorpath=/help/api/2012.1/ui.iggrid#events
To hide the grid you can use "ui-iggrid". This class is applied to the top container element
https://www.igniteui.com/help/api/2019.1/ui.iggrid#theming
Take a look at the code snippet below :
[code]<style type="text/css"> .hiddenGrid { visibility: hidden; display: none; }</style><script type="text/javascript"> $("#grid1").live("iggridheaderrendering", function (event, args) { if (args.owner.dataSource.dataView().length === 0) { $(".ui-iggrid").addClass("hiddenGrid"); } });
</script>[/code]
Let us know if you need further assistance.
How do you hide the grid in MVC as the OP asked instead of client-side?