This example shows how to select and bind ASPxGridView to a data source at runtime. The page contains ASPxGridView, ASPxRadioButtonList and three data sources (SqlDataSource). In design mode the grid doesn't have any column. You should add all columns manually by using an appropriate algorithm. We have created columns as this is done in selected data columns. If a data source has insert, update or delete command, a command column will be appended to the grid.
Grid's data source is changed by clicking list items. Note that the EnableViewState property is set to false. It is done to avoid exceptions on binding the grid to another data source.
See also:
How to dynamically switch the grid's data source and recreate columns at runtime
How to bind ASPxGridView with autogenerated columns to different data sources at runtime. The grid is created at design mode
How to bind ASPxGridView with autogenerated columns to different data sources at runtime. The grid is created in runtime mode
Question Comments
Added By: Bjorn Padding at: 11/4/2015 11:49:35 AM
I have a XAF application and require the same of what is asked here (https://www.devexpress.com/Support/Center/Question/Details/T216541) by Yasir 9 months ago, to create a timesheet with a UX friendly interface like this one here (https://www.devexpress.com/Support/Center/Attachment/GetAttachmentFile/badaed21-c3f3-11e4-80ba-00155d624807). Even if I would choose to go down this (from a XAF perspective) hackery route of implementing what I want in this application, how would I even seamlessly integrate that under a clickable navigation item in my XAF application? I have tried to approach my problem from several perspectives with my multi-platform knowledge and I have a very hard time coming a acceptable solution. My timesheet reporting tool also has several association to different tables for its projects and users and a bunch of other stuff and this solution would basically make the application error-prone when somebody makes a change to this part of the program, not knowing that he has to modify all kinds of SQL-code in a ASPx page somewhere else. I am even volunteering for the job to write a nice XAF extension for this, but also this seems like it would be a living nightmare to do in comparison to other platforms, like nodejs, for instance, or even PHP or what have you.
As I said. I am willing to volunteer for the task, but then I obviously will need youur help on how to write a nice controller for this that would support both web and win modules.
I hope to hear from somebody.
Best,
B
Hello Bjorn,
To process your recent post more efficiently, I created a separate ticket on your behalf: TimesheetControl (no not SchedulerControl). This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.