Hi, I am using ASP.NET & C# for my project. So, as per my requirement I need to design & create Ignite UI grid dynamically from codebehind (aspx.cs) page. Say, I have a panel created in aspx page, I can dynamically add controls to the panel on Page_Load() event. But is there any possible way I can create the grid and add it to the panel from codebehind. Like in ASP.NET MVC, I can create a GridModel object and dynamically add columns, properties & features from controller and return the model to view. Regards Rahul S
Hello Rahul,
Please review this sample - https://www.igniteui.com/hierarchical-grid/load-on-demand
It is demonstrating the usage of GridModel and creating a grid from the model. Let me know if this is what you require or you need something more specific?
Hi Deyan,
Thank you for your quick response.
I am aware of "Load on Demand" functionality of Iggrid, But in all the examples they are trying to design the grid from controller and returning GridModel to the view. But I need the same logic to be applied in normal asp.net. i.e, creating Gridmodel and configuring it in codebehind(aspx.cs) and creating the grid dynamically from codebehind. Like say, I have a panel & I need to create the grid and add it to the panel.
Waiting for your response.
Regards,
Rahul S
Create your grid in separate view and load the view when you need it into your panel.
I've prepared a demo for you, let me know if it achieves your requirements.
Thank you once again for your quick response.
I went through the demo which you have provided. It uses ASP.NET MVC architecture to design the grid. Like, when I click on the button it redirects to Controller and the grid is dynamically loaded. But, as per my requiremnt I need to do the same with aspx & aspx.cs pages. The normal codebehind concept (Webforms). I will not be using ASP.NET MVC architecture at all. I will be creating a webform webapplication. I need to create the grid and add it to may be say an updatepanel from codebehind. So, I need to know whether it can be done from webform concept. I do understand MVC is the best way to do it. But my requirement is diffrent.
There are wrappers for MVC only.
But you can send ajax request to get the grid settings from the server and once they are on the client you can create the grid based on those settings.
Please review the demo I've prepared for you.
Hello Deyan,
Sorry for the delay in response.
I went the the demo which you provided. I was able to create the grid. I do have one more query. How can we enable Ignite UI grid features like Groupby, Updating, Column Fix, . .and dynamically bind that to aspx page.
Thank You
Regards
The approach is the same, only that the Updating feature requires unique primaryKey defined. Here's the sample with Updating
Thank you for the demo.It was very helpful. But, have a issue; How to enable updating feature and do grid updating. Can you give me a solution for that.
I would suggest recreating the grid with the new features configuration. Please review the modified sample I'm attaching.
Is this what you're trying to achieve?