This is a migrated thread and some comments may be shown as answers.

Rad Date Picker - date does not change when type into dateinput

9 Answers 475 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Gaurav
Top achievements
Rank 1
Gaurav asked on 04 May 2009, 07:12 AM
Hi,
I am having problem with RadDatePicker when user manual (types into built in Dateinput box) enter date.

Here is details.

I have RadDatepicker control inside RadGrid EditItemTemplate and uses Shared Calendar:

Design :

 <radG:GridTemplateColumn UniqueName="TemplateColumn" EditFormColumnIndex="1" HeaderText="Date"
                                                                                        DataField="TransactionDate" SortExpression="TransactionDate">
                                                                                        <HeaderStyle Width="110px" HorizontalAlign="Center" />
                                                                                        <ItemTemplate>
                                                                                            <asp:Label runat="server" ID="lbldate" Text='<%# Bind("TransactionDates") %>'></asp:Label>
                                                                                        </ItemTemplate>
                                                                                        <EditItemTemplate>
                                                                                            <radCln:RadDatePicker ID="rdTransactionDate" runat="server" Width="110px" MinDate="1960/1/1"
                                                                                                MaxDate="2099/1/1" Calendar-Skin="Default2006" UseEmbeddedScripts="false">
                                                                                           <DateInput ></DateInput>
                                                                                            </radCln:RadDatePicker>
                                                                                            <asp:CustomValidator ID="cvTransactionDate" runat="server" ClientValidationFunction="CheckDate"
                                                                                                ControlToValidate="rdTransactionDate"></asp:CustomValidator>
                                                                                        </EditItemTemplate>
                                                                                    </radG:GridTemplateColumn>

Code:

Inside Grid ItemCreated event Calendar is assigned to Datepicker.
It works fine when date is change using Calendar but does not work when user type into dateinput box to change the date.
Initially I thought it might be due to Ajax setting ( I might have missed of the related settings) but I have also checked by removing all Ajax Manager setting and tested the situation but it still it did not work.

During my testing I found out following details:

OndateSeleted does not fire when User types the date to change it.
Please let me know if I am missing any settings here because it should fire when
1) User chooses as date from Pop Calendar
2) User types the date to change

I would highly appreciate if you could provide any details to solve this problem.

Thanks





9 Answers, 1 is accepted

Sort by
0
Gaurav
Top achievements
Rank 1
answered on 04 May 2009, 07:27 AM
Hi,

When I say date does not change:

We use Grid's insert/update functionality to insert/update record in datatabse table.

Now when date is typed into the dateinput box , it does show in there but when user clicks "update" link to save the changes it does not reflect when grid rebind.

Inside RadGrid _UpdateCommand /_InsertCommand events I used newValue collection to extract new values using "ExtractValuesFromItem" method of Grid.

Code:

                 GridEditableItem editedItem = e.Item as GridEditableItem;
                GridEditManager editMan = editedItem.EditManager;

                Hashtable newValues = new Hashtable();
                //The GridTableView will fill the values from all editable columns in the hash
                e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem);

                newValues["TransactionDate"] = (editedItem.FindControl("rdTransactionDate") as RadDatePicker).DbSelectedDate;
                if (newValues["TransactionDate"] != null)
                {
                    newValues["TransactionDate"] = Convert.ToDateTime(newValues["TransactionDate"]).ToShortDateString();
                }

BTW: This is additonal information that might be helpful to identify problem.

Thanks,
Gaurav
0
Pavlina
Telerik team
answered on 07 May 2009, 01:03 PM
Hi Gaurav,

Binding a RadDatePicker control to a data source is easy provided you use the DbSelectedDate property. You can review the following online demo:
RadDatePicker - Data Binding

Sincerely yours,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Gaurav
Top achievements
Rank 1
answered on 08 May 2009, 06:07 AM
Hi,

Binding is not a problem here. Let me explain it again.

Changing date using Popup Calendar:

When date is selected using Popup Calendar (use shared calendar) then change is reflected when you extract new values in update/insert command of Rad Grid to save data into Database table. OndateSeleted  fires in this case

Changing date by typing into built in Dateinput box:
Now here when user types into dateinput box  and after change the date when tries to save date the change does not available in Insert/update command when you try to extract new values. OndateSeleted  does not fire in this case.

So I basically I would like to know is there any settings that i might be missing here to manual (type into) change date in dateinput box particularly when datepicker is inside RadGrid. Again If you think it is related to binding then please let me know because we set database value to datpicker in code bind when record is in editmode otherwise it is displayed in lable as you can see in the design snappet that I provided in my first post

Please let me know.

Thanks,
Gaurav
 

0
Pavlina
Telerik team
answered on 11 May 2009, 04:51 PM
Hello Gaurav,

I followed your scenario in order to replicate the issue but to no avail. At this point in order to progress in the resolution of this matter, I will ask you to open a formal support ticket and send me a small runnable application with reproduced this erroneous behavior. Thus I will do my best to help you further in resolving it.

Kind regards,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Gaurav
Top achievements
Rank 1
answered on 12 May 2009, 05:45 AM
Hi,

Thanks for your feedback. I will do so as per your instructions.

Best Regards,
Gaurav
0
Gaurav
Top achievements
Rank 1
answered on 13 May 2009, 07:09 AM
Hi,

Regard the problem I have found the solution.
Actually I was creating test page which can duplicate the same problem avail in Original page.
I added controls one bye one from Original page to test page ( as our original page is very complex) and tested for the given problem.

During this process I noticed that It was related to "RadTabStrip" control's "UseEmbeddedScripts" property.

If I set this property to False (e.g UseEmbeddedScripts="False") then we have the problem.
If I set this property to True (e.g UseEmbeddedScripts="True") then we it works fine.

I am not sure how it is related to Rad Date picker inside Rad Grid. I  definitely would like to know from anyone who can explain this behavior.

But as of now my problem is solved.

Thanks very much for your response.

Best Regards,
Gaurav
0
Pavlina
Telerik team
answered on 15 May 2009, 05:58 AM
Hello Gaurav,

When you set UseEmbeddedScripts property to true the RadDatePicker control automatically load its scripts from the embedded web resources and your project is working properly.
Since you have set UseEmbeddedScripts to false, you need to have the RadControls folder deployed.
You can read this help article which explains how to do this:
The 'RadControls' Folder

Best wishes,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Bartłomiej
Top achievements
Rank 1
answered on 30 Mar 2012, 11:38 AM
Hi.

The problem still exists. 
I heve RadDatePicker on page and button "save". When i change date manually then press button save. But the focus is on DatePicker. Date doesn't change.
Eny solution ???
UseEmbeddedScripts is set to true  

Best Regards, 
Bartek
0
Pavlina
Telerik team
answered on 03 Apr 2012, 07:23 PM
Hello,

At this point to be able to provide further assistance we will need a sample runnable project in which we can replicate the described problem. You can open a formal support ticket and attach the project there. Thus we will be able to debug it locally and provide a solution/fix.

All the best,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Calendar
Asked by
Gaurav
Top achievements
Rank 1
Answers by
Gaurav
Top achievements
Rank 1
Pavlina
Telerik team
Bartłomiej
Top achievements
Rank 1
Share this question
or