Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > TimePicker > Directly typing in the time

Not answered Directly typing in the time

Feed from this thread
  • Terry Intermediate avatar

    Posted on Jun 18, 2010 (permalink)

    As long as I pick a time from the dropdown, everything works OK, but in the RowValidating event, if I type a time directly into the textbox and then click on another row, the e.Row.DataContext still has the old value.  However, if I tab to the next column, the value is updated.

    I think this is a bug.  The DataContext should update, no matter how you exit the cell, prior to the RowValidating event.

    So, to give you a specific example, here is my RowValidating code:

            private void gvTimeSheet_RowValidating( object sender, GridViewRowValidatingEventArgs e )  
            {  
                ChargeInfo chg = e.Row.DataContext as ChargeInfo;  
     
                // require end time > starttime and <= 12 hours  
                // OK to roll over to next day  
                TimeSpan ts = chg.EndTimeSpan - chg.StartTimeSpan;  
                if ( ts == new TimeSpan( 0, 0, 0 ) )  
                {  
                    MessageBox.Show( "Start time cannot equal end time" );  
                    e.IsValid = false;  
                    return;  
                }  
                else if ( ts < new TimeSpan( -12, 0, 0 )  || ts > new TimeSpan( 12, 0, 0 ) )  
                {  
                    MessageBox.Show( "Individual time charges > 12 hours are not allowed." );  
                    e.IsValid = false;  
                    return;  
                }  
            }  
     
     

    If I edit a row with an 11:00 AM start time and a 1:00 PM end time, changing the end time to 11:01 PM, I should get an error message since the elapsed time is greater than 12 hours, but if I exit the end time field by clicking on another row in the same column, the end time in the DataContext is still 1:00 PM and no error is triggered.  If I come back to the row to edit it again, the DataContext and the underlying binding have the new invalid time, 11:01 PM.

    How can I resolve this problem?

    Thanks,

    Terry 
     

    Reply

  • Terry Intermediate avatar

    Posted on Jun 18, 2010 (permalink)

    Another thing I just noticed:  When I revise a time by directly editing the textbox and then tab to the next field, the old value is displayed.  When I click back into the time textbox to put it in edit mode, the new value is then displayed. 

    Here's what the xaml for the time columns looks like:

                        <!-- Start Time --> 
                        <radGridView:GridViewDataColumn Header="Start Time" 
                            DataMemberBinding="{Binding StartTimeSpan, Mode=TwoWay}">  
                            <radGridView:GridViewDataColumn.CellTemplate> 
                                <DataTemplate> 
                                    <TextBlock Text="{Binding StartTimeSpan, Converter={StaticResource TimeSpanToStringConverter}}" /> 
                                </DataTemplate> 
                            </radGridView:GridViewDataColumn.CellTemplate> 
                            <radGridView:GridViewDataColumn.CellEditTemplate> 
                                <DataTemplate> 
                                    <radInput:RadTimePicker TimeInterval="0:15:0"     
                                         SelectedTime="{Binding StartTimeSpan, Mode=TwoWay}" /> 
                                </DataTemplate> 
                            </radGridView:GridViewDataColumn.CellEditTemplate> 
                        </radGridView:GridViewDataColumn> 
                          
                        <!-- End Time --> 
                        <radGridView:GridViewDataColumn Header="End Time" 
                            DataMemberBinding="{Binding EndTimeSpan, Mode=TwoWay}">  
                            <radGridView:GridViewDataColumn.CellTemplate> 
                                <DataTemplate> 
                                    <TextBlock Text="{Binding EndTimeSpan, Converter={StaticResource TimeSpanToStringConverter}}" /> 
                                </DataTemplate> 
                            </radGridView:GridViewDataColumn.CellTemplate> 
                            <radGridView:GridViewDataColumn.CellEditTemplate> 
                                <DataTemplate> 
                                    <radInput:RadTimePicker TimeInterval="0:15:0"     
                                         SelectedTime="{Binding EndTimeSpan, Mode=TwoWay}" /> 
                                </DataTemplate> 
                            </radGridView:GridViewDataColumn.CellEditTemplate> 
                        </radGridView:GridViewDataColumn> 
                         
     

    Reply

  • Kaloyan Kaloyan admin's avatar

    Posted on Jun 24, 2010 (permalink)

    Hi Terry,

    Could you specify the version of our controls that is leading you to this problem.

    Greetings,
    Kaloyan
    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

    Reply

  • Terry Intermediate avatar

    Posted on Jun 24, 2010 (permalink)

    Hi Kaloyan:

    We're using Silverlight 4 with version is 2010.1.412.1040.

    Reply

  • George George admin's avatar

    Posted on Jun 30, 2010 (permalink)

    Hello Terry,

    Thank you for contacting us.

    All our attempts to reproduce the problem failed. If you could send us a sample running project that reproduces the problem will be really helpful.

    I will be glad to assist you further.

    Sincerely yours,
    George
    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

    Reply

  • Terry Intermediate avatar

    Posted on Jun 30, 2010 (permalink)

    Actually, we recently upgraded to v 2010.1.603.1040 and the problem went away.  Thanks for your help.

    Terry

    Reply

  • George George admin's avatar

    Posted on Jul 1, 2010 (permalink)

    Hello Terry,

    I am glad that the issue you were facing is now resolved. Please do not hesitate to contact us if you have any additional questions.

    It was pleasure for me to assist you. Wish you a great day.

    Regards,
    George
    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

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > TimePicker > Directly typing in the time
Related resources for "Directly typing in the time"

Silverlight TimePicker Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]