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

Auto setting for GridDateTimeColumn

1 Answer 47 Views
Grid
This is a migrated thread and some comments may be shown as answers.
berto
Top achievements
Rank 1
berto asked on 04 Oct 2012, 08:49 PM
Hello,
I have following code:

<telerik:GridDateTimeColumn FilterControlWidth="140px" DataField="Datum" HeaderText="Datum"
    SortExpression="Datum" UniqueName="Datum" PickerType="DateTimePicker"
    EnableRangeFiltering="true" CurrentFilterFunction="Between" ReadOnly="True" AllowFiltering="True" FilterListOptions="VaryByDataType">
    <HeaderStyle Width="220px" />
</telerik:GridDateTimeColumn>

I would like to implement followin: After one of two dates will be picked second one should be set to the same value. How I can implement this behaviour with the simplest solution?


1 Answer, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 08 Oct 2012, 04:19 PM
Hi Berto,

One exemplary realization of the desired functionality could be achieved by catching the OnItemCreated event.
It includes the following steps.
  • OnItemCreated check if the item is a GridFilteringItem
  • Extract the value of the first picker
  • Attach an client-event for catching the OnDateSelected event.
  • In the client-event find the second picker by a custom attribute(which you have set)
  • Set the value of the second picker
Using this approach I have created a simple project that you could use as an example.

Kind regards,
Angel Petrov
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
Grid
Asked by
berto
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Share this question
or