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

Can't set time portion for datetime-picker column

4 Answers 188 Views
GridView
This is a migrated thread and some comments may be shown as answers.
M
Top achievements
Rank 1
M asked on 02 Jun 2010, 05:07 PM
Hello,

we have the following problem on a radgridview that is bound to an observable collection of entities (entities of EF class):

After binding the collection to the grid the date is shown with its time portion just as expected. Problem is, when setting / edting the date (either manual or via the picker) the time is being re-set to 00:00:00, which can't be changed. When manually trying to specify the time it is again re-set to 00:00:00. Is there a way to edit the time portion as well, i.e. to set the time somehow (this feature would be crucial for us!!!!).

Our xaml is pretty standard:

            <telerik:RadGridView x:Name="radBerthingSlots" 
                AutoGenerateColumns="False" 
                MaxHeight="500" 
                IsEnabled="True" 
                ItemsSource="{Binding BerthingSlots}">  
                <telerik:RadGridView.Columns> 
                    <telerik:GridViewDataColumn Header="High Tide Date" DataMemberBinding="{Binding HighTideDate}" />
                </telerik:RadGridView.Columns> 
            </telerik:RadGridView> 

I tried a couple of things including adding a timespan property to our EF class to circumvent the issue, but I have given up now (spend already 2 days on this).

Please advise....

Regards...

M

4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 03 Jun 2010, 06:41 AM
Hi M,

You can check this demo to know more how to edit time separately. The example is for Silverlight however the same will work for WPF as well.

Best wishes,
Vlad
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
M
Top achievements
Rank 1
answered on 03 Jun 2010, 06:15 PM
Hello Vlad,

thanks for your quick reply....

I've implemented your suggested solution and it works fine so far. However it has still a few quirks.....

One problem is that when manually typing / keying in the time (i.e. not using the time picker itself, or when specifying the minutes) and then leaving the cell (tab / mouse click) the changes are not stored. I have to actually hit "enter" or move into the date picker of the same column to persist the changes). Is there a way to get round this and allow updating the edited time when leaving the cell?

Many thanks in advance

M

P.S. I just tried, and the same applies to the date picker as well..... leaving the cell reverses the changes......
0
Nedyalko Nikolov
Telerik team
answered on 08 Jun 2010, 07:13 AM
Hello M,

The problem comes from the fact that DatePicker updates its own binding source on lost focus event, but RadGridView commits all pending edit when another cell is about to enter into edit mode (got focus) and lost focus is not fired for the previously edited cell yet. The solution is simple just update source on every property change.
Unfortunately there is no workaround for this problem. I've just talked with the team responsible for RadDateTimePicker control and our solution is to add UpdateSourceEvent enumeration (LostFocus, PropertyChanged). We'll try to add this for the 2010.Q2 official release.
I hope this will help.

Regards,
Nedyalko Nikolov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Joel Palmer
Top achievements
Rank 2
answered on 15 Mar 2011, 11:11 PM
Posted in the wrong topic.  Never mind.
Tags
GridView
Asked by
M
Top achievements
Rank 1
Answers by
Vlad
Telerik team
M
Top achievements
Rank 1
Nedyalko Nikolov
Telerik team
Joel Palmer
Top achievements
Rank 2
Share this question
or