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

Make GridDateTimeColumn filter text box readonly

1 Answer 155 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Content and Code
Top achievements
Rank 1
Content and Code asked on 16 Feb 2011, 01:05 PM
Hi,

I have a grid with some date time columns. It allows me to filter by choosing a date from a calendar or typing in the date manually.

I want to restrict this so that the user is only able to pick the date from the calendar and cannot type in anything in the text box. Below is the markup:

            <telerik:GridDateTimeColumn DataField="EndDate" HeaderText="End Date"
                SortExpression="EndDate" UniqueName="EndDate" PickerType="DatePicker" DataFormatString="{0:dd MMM yyyy}"
                AutoPostBackOnFilter="true">
                <HeaderStyle Wrap="false" />
            </telerik:GridDateTimeColumn>

In the item created event I have:

 RadDatePicker rdpEndDate = filteringItem["EndDate"].Controls[0] as RadDatePicker;
                rdpEndDate.DateInput.ReadOnly = true;
                rdpEndDate.Width = Unit.Pixel(100);

Although this makes the textbox readonly, it totally disables the filter functionality i.e. I select a date and tab out of the text box but nothing happens.

1 Answer, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 21 Feb 2011, 12:38 PM
Hi Content and Code,

Thank you for contacting us.

I tried to reproduce the described issue but to no avail. I am sending you a simple example based on your code. Please check it out and let me know what differs in your case. Also on the following link I attached a small video which demonstrates how the example works on my side.

Looking forward for your reply.

Regards,
Radoslav
the Telerik team
Tags
Grid
Asked by
Content and Code
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Share this question
or