My goal here is to store a list of dates selected in a calandar to a database. The problem with most calendar controls that exist, for asp.net, is I can't get the date that was unselected with multiselect enabled. I can get a list but that is really it. I have decided not to use these because of this.
If I wanted to create my own event using the jQuery calendar below how would I go about doing this? The event would capture the day clicked, if it was unselected or selected, etc. I would use this to add/remove the dates from a collection. It is almost like how the other calendars work except for the remove part. The dates removed would be in it's own list so I know what dates to remove from the database once 'save' is clicked. I hope this is enough information.
http://www.eyecon.ro/datepicker/#about
Using Visual Studio 2005/.NET 2.0. c#
if you wanted to save multiple dates (list), you could:
-use jquery to create 1 input box for selecting date and another list area the selected dates
-on post back, have the server code check the list area for all the selected dates
if you wanted to save only one date, you could:
-use jquery to create 1 input box for selecting date
-on post back, the server code check for the that input box
hope that helps.
Related
I need to create a RDLC report from a MySQL db that needs to show timecard info per user, per day between 2 dates (user choice) Like this eg:
UserFirstName UserLastName
2019-01-11 InTimeStamp OutTimeStamp TimeSpan
2019-01-12 InTimeStamp OutTimeStamp TimeSpan
2019-01-13 InTimeStamp OutTimeStamp TimeSpan
2019-01-14 InTimeStamp OutTimeStamp TimeSpan
Total: totalTimeForThePeriod
I need this for every user within the dates provided by the user.
I have already setup the HR report page and the date choice (works perfectly) but I can`t seem to be able to format my RDLC report to show the info as requested. How can I seperate the data to acheive this? My dataset gets all the data from the db (query works great). All I need to do now is to show it properly in the report. Any ideas on how I can acheive this?
I've tried using a simple table but that does'nt work.
I also tried a matrix, but I can't seem to show the data as requested.
You'll want to go one by one creating your rows. Also have your Grouping window open, so you can see your grouping. First right click where you want your first row and click Add Group -> Parent Group. In the Group by: drop down select a UserFirstName. Then it should add UserFirstName to your grid. To the right of it add UserLastName. Next in your grouping window under Row Groups click the drop down arrow on (UserFirstName) and click Add Group->Child Group. This time group by [TimeStampDate]. This will create a new row under your original row that is a sub group of UserFirstName. Add in the addition data in this new row. Lastly in the grouping window under Row Groups click the drop down on TimeStampDate then click Add Total->After. This should add a total row under the TimeStampDate row. You can change the [Sum(TimeStampDate )] to [totalTimeForThePeriod]. This should get you what you need.
[UserFirstName] [UserLastName]
[TimeStampDate] [InTimeStamp] [OutTimeStamp] [TimeSpan]
Total: [totalTimeForThePeriod]
I struggled with the same issue for hours, so I hope this helps!
I'm new to ASP.NET and C# and I'm having trouble completing a project. I'm trying to create a page where a user can select an item from a drop-down list, which contains four options. Each option is tied to specific days and times of the week. I'm trying to make it so when a user selects an option where the specified days are Monday, Wednesday, and Friday, it makes it so the corresponding calendar only allows for Monday, Wednesday, or Friday to be selected.
No way ofdoing this the way you want to. Check out some javascript calendar pickers that can be configured to only allow certain months and use that on front end.
Perhaps you can store the current selection and then in the on select event if the event is one you don't want the user to select then reselect the stored (previous) selection?
I have a DataGridView with several TextBoxColumns and one ComboBox column called 'combo' that holds the client type. The problem is that I'd like to show both the currently selected client-type value along with the dropdown client-type list to validate future changes by the user. In SQL Server, I have a DB with two table columns, 'client_type_dropdown.name' and 'clients.client_type'. The 'client_type_dropdown.name' column is a validation list. The 'clients.client_type' column contains the current client type for clients in the database. Is there a way to show in 'combo' both 'client_type_dropdown.name' and 'clients.client_type' , i.e., one source for the ComboBoxColumn dropdown and a different source for the textbox part of 'combo'? Or do I need to have two columns in my grid?
I appreciate your help.
I'm using a third party grid, but I usually handle this by setting the combo drop down style to DropDown instead of DropDownList. This will allow your original database value to display, even if it isn't in the list.
This also allows free typing of values into the combo field, so the trick after that is to validate the user input to make sure it matches a value in the list before you allow them to save updated values. You could play around with the LimitToList property of the combo to possibly save you doing the validation manually, but with most controls I have worked with it will give you more grief than help.
I have a button in every row of my DataGridView. When that button is clicked, a calender should be displayed in which the selected dates (I have in list) should be bolded. The dates will be different for different buttons and so the bolded dates should also be changed for every button click. Is it possible to have a tag for every bolded date?
Is the single calender is sufficient or should I declare number of month calenders for every button.
I am very new to C#, please reply me the answer.
You can reuse the same Calendar control by specifying different BoldedDates.
DateTime[] myDates = {myDate1, myDate2};
calendar.BoldedDates = myDates;
Look at here and here for more details about bold dates.
I have a date picker control that I use for a data collection application. It is using MvvM data binding. When going through a list of dates (see fig1) it will populate the date picker correctly. Whenever I hit new, the date pickers are nulled out. When I pull up the popup, it selects the month and year from the previous date that was set to. (fig 2) Is there anyway to default the pop up show the current month in the current year?
Note : I would like to keep the selected date to null on a new entry to force some validation.
Fig 1
Fig 2
The following image is to show what happens when I set the DisplayDateStart.
(original answer was horribly wrong, sorry about that)
Okay, lets try this again.
Have you tried setting the fallback to today's date?
SelectedDate="{Binding TehDate, FallbackValue={x:Static sys:DateTime.Now}}"