I've been asked to develop a system wherein employees can mark on a form their availability on a given day of the week - for instance an employee could mark themselves as available on a given time on a given week, and unavailable on some other time. It looks a little like this:
http://img697.imageshack.us/img697/842/mvcb.jpg
Currently this works by rendering checkboxes within the table, picking up click events in each cell and marking the checkbox and hence the cell appropriately. I'm using the JQuery "click n drag checkbox" plugin from here. However, I've been informed that there could well be more than two states for a given cell (for instance available, unavailable, available in a given circumstance), in which case binding to a checkboxes checked value isnt going to be a lot of help.
I've never used javascript or asp.net before and am unsure as to the best way to approach this problem. Ideally I could stick a data structure behind each cell which I could update to a certain state and then get my cell colour by binding to this - however I'm at something as a loss as how to best achieve this.
Add a click event to the cell - e.g. click on the cell. Each click could then change the status of the cell. This status could then be store via ajax or using a submit button like on a form. Each cell could relate to a hidden form field which is where you status could be kept.
Maybe take some inspiration from google calendar. There you can select a timespan in the month view by click-dragging a range of days. I guess thats a faster way of entering longer timespans. (Like the lower part of the dragon)
Related
I have gone through many articles and similar kind of stack over flow questions. Almost I spend more than a day trying to find the solution, all goes in vain.
First I should tell you what I am trying to make.
There a simple grid having a text box currently
Similar to this article
So when I put some value to text box it generate these text boxes and checkbox within that row.(image related to above description)
There are events firing when text box value get changed , second when add new row is clicked.(Currently ignore delete button event).
What I earlier planned was like this, create controls in every postback,I have saved first row text box values in a viewstate. I create these dynamic controls in grid-row-bound function. So I create no of controls as according to value in viewstate stored value.
I thinked that on event function call I will first store the value of current controls then recreate all controls with same id and put back the value.So problem I am facing is that I can't find my controls on event fire. You can see in these two pic what happening because of that 1st pic 2nd pic.
If you want to see the code , please comment of which sections you want to see the code or full code
Here the link to the code click here
My client wants to have a datetimepicker in his datagridview.
I tried example from MSDN(CalendarColumn) but it doesnt fit some of my client's needs.
I also tried example where you replace textbox with datetimepicker but it has same problems.
So i dumped idea of datetimepicker and started working with just a textboxfield
Control is almost done but some details are missing, can you help me with solving them?
Can i have multiple input fields inside one cell like datetimepicker does?
Can i enter edit mode on textboxfield and go straight to it? currently it first selects all data that are in the cell. can i skip it and go straight to editing where mouse cursor was?
Can i have some kind of maskedtextbox functionality? so that my client enter only numbers, and for him it will show with separators. (i solved it via text changed event but maybe there is a better way)
Thank you for your time!
I came across a tutorial and some example code for an audio converter. You select the format you want to convert to from a drop down, and when you do all sorts of options appear in a previously blank area, different options based on the format you choose. It's called Audio Converter .NET and is from same author as Audio CD Ripper .NET. I can't find the tutorial, but here is a screenshot.
See how on the right there is extra controls that are not on the left. I was experimenting trying to add another category. I added it to the dropdown, but am unsure how to make it so certain fields come up when it is selected.
I understand that they create those controls for those items, but I don't see how they call the correct one when the combo box selects something. I see controls are created, but if I try to duplicate the controls into another entry in the combo box they don't show up for either the new or old one I was duplicating from.
What's the best way to go about achieving something like this?
Thanks
The easiest way is to create the controls needed for every option in the dropdown inside a panel, and simply turn it's visibility property from false to true whenever it's corresponding option is selected using the combobox's SelectedIndexChanged event handler. (And don't forget to turn the current visible panel's visibility to false)
I'm using .NET's DateTimePicker in a dropdown UITypeEditor to show in a property grid. The DateTimePicker shows a redundant line that means you have to click twice to show the useful calendar bit. How can I hide it so it skips straight to the calendar?
Backstory: Previously used used MonthCalendar, which doesn't have the redundant line. However, MonthCalendar crops itself sporadically (when edit one date in the grid, then another), which looks bad.
I don't think that there is any (easy) way to remove this part because is what defines the DateTimePicker as opposed to MonthCalendar.
What you call "useful calendar bit" is actually a MonthCalendar, why don't you rely on this control instead?
Or if you don't want to rely on MonthCalendar, perhaps you should consider a custom DateTimePicker: lots of codes in internet (sample1, sample2); even creating one by your own (after getting some inspiration from the available ones). Anything before considering the option of modifying a so important part of the control.
I have an ASP.NET page where at the top of the page is a search box. There are 2 text boxes - one is an autocomplete extender for the Name on a database, and one is just inputting the ID.
The page features DetailsViews and GridViews primarily, and even when no account has been searched for, these display blank data which is not ideal. I sort of fixed this by using if (IsPostBack), encasing the elements in a placeholder and setting it to visible only if the page ispostback. But this doesn't cover if the user types in an incorrect ID.
Also, some accounts have huge amounts of data inside the GridView's. I had an issue where because I have no way of detecting when a data source's rows has changed, I end up binding whenever the page loads (Page_Load method). I've come to realise this is simply very bad - there are lots of times when the user can click various things in the page and have the page postback, and it takes an eternity to load each time I click something for accounts with lots of data.
Anyway, my question is essentially two-fold but I have a feeling the solution will be similar:
1: How can I detect when there are no accounts returned when searching, and disable the Grids/Detailsviews and show an error message?
2: How can I figure out when the user searches for another account and only rebind the grids after that has happened?
Thanks
This method is very ugly but it'll get the work done.
1) To Check whether there are no records; after the AutoComplete Extenders Webservice is called if no record is returned put some value in Session like
Session["NoData"]=true;
if Records are found then;
Session["NoData"]=false;
after the webservice is called do ajax request to check that session & on the basis of value do what you want.
2) You can achieve this also by following the above option.