ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
grid dynamic columns
Title:
B
I
{code}
?
I'm looking to make a grid that would list employees in the first column and then, depending on the range of dates entered in datepicker controls outside the grid, have those dates listed in the columns to the right of the employee name. I'd like to be able to edit the value in each of the cells where the employee and date intersect. So, binding to the columns would need to be dynamic. For update purposes, the action controller would need to be passed a different ID based on the cell in the grid that's being updated along with the value entered in the Edit. How could i achieve this? I'm using this to store a notation for every day per employee (in regards to attendance). If you pick 1/17/21 and 1/19/21 in the datepickers, there would be a total of 4 colums: Employee Name, 01/17/21, 01/18/21, 01/19/21. If you pick a wider range of dates, the count of columns would grow. Then, have editable cells in the grid. I was assuming that when editing a cell, both the ID and value of the cell would need to go back to the controller. I'm storing one row in the database for each employee and date.
Save Changes
Cancel
Sean Davidson
asked at 25 Jan 2021
think the easiest will be to use aweui, have a look at this grid: https://aweui.aspnetawesome.com/#Grid-inline-editing each time the date range changes you can call `awe.destroy($('#id'))` to destroy the grid and rebuild it again using `aweui.grid`, and each time you can give it a different set of columns and data function; for editing you can use inline editing mod as in the mentioned demo, or you could do it like here: https://demo.aspnetawesome.com/GridSpreadsheetDemo#Simple-spreadsheet-grid
at 25 Jan 2021
Omu
Answers
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK