Creating a table dynamically, with multiple lines of text in each cell and each cell being clickable, in ASP.NET

我的未来我决定 提交于 2019-12-11 13:31:35

问题


I'm trying to design a calendar-type table that is built dynamically based on data from a separate database source.

This is an illustration of the basic design idea:

Here's an image:


If an object was added that was referenced to a Saturday, another column would be added and if the one on Monday was removed, the column would disappear and vice versa.

The weekdays are column headers and the squares represents cells with some lines of information. Each cell in its whole should be clickable.

The entire table should show a single month only.

I'm thinking this might be very time consuming to implement, and will quite quickly become impossible to re-read and understand later on if it isn't designed right. So if anyone has a more simple way to implement a month-view of a calendar, with some lines of information stored in each cell, and a possibility to call Server.Transfer() on the click event of a cell, it would be just as ideal.

As far as I know, the Calendar component doesn't support editing the contents of the cells in calendar, and other than that I don't really know which way would be the best way to go.

If I can improve the question in any way, please let me know.


回答1:


I think what you want is not a Calendar, but rather a Scheduler control, which includes functionality to display a calendar view, add/edit "appointments" and provide events of what happens when you click them.

This thread lists a lot of such Scheduler control that you can use, some of them free.

Here are some additional links that implement similar functionality:

  • http://www.rekenwonder.com/aspnet/schedule.html
  • http://www.codeproject.com/Articles/7619/Databound-Schedule-Controls
  • http://www.codeproject.com/Articles/31766/DayPilot-Scheduler-Control-for-ASP-NET

I think reusing one of those components and spending some time to research them would be much less time consuming that implementing your own solution from scratch. If what you want falls into those common UI patterns supported by those controls, you'll be fine.

If, on the other hand what you want is not a common practice, you may rethink your approach.



来源:https://stackoverflow.com/questions/10489552/creating-a-table-dynamically-with-multiple-lines-of-text-in-each-cell-and-each

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!