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

How do I customize the filter date picker control of a GridDateTimeColumn?

2 Answers 186 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Hendrik
Top achievements
Rank 1
Hendrik asked on 26 Aug 2010, 06:01 PM
I'd like to change the appearance of the date shown within the filter row of my griddatetimecolumn and set it from the default to my native german style.

How do I do that ??

I've tried the itemcreated-event of the grid, but without any success:

    Protected Sub Grid_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs) Handles Grid.ItemCreated
        If TypeOf e.Item Is GridFilteringItem Then
            Dim filteringItem As GridFilteringItem = CType(e.Item, GridFilteringItem)
            'set dimensions for the filter textbox
            'Dim box As TextBox = CType(filteringItem("ContactName").Controls(0), TextBox)


            Dim filterItem As GridFilteringItem = DirectCast(e.Item, GridFilteringItem)
            Dim DateOpened As RadDatePicker = DirectCast(filterItem("column1").Controls(0), RadDatePicker)
            DateOpened.Culture = //some variable i store in session
        End If
    End Sub 'RadGrid1_ItemCreated

Any advice/ hint on this for me ?? Thanks in advance
Hendrik

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 27 Aug 2010, 07:26 AM
Hello Hendrik,

You can specify culture to the RadDatePicker in filter item like below.

VB.Net:
Protected Sub RadGrid1_ItemCreated(sender As Object, e As GridItemEventArgs)
    If TypeOf e.Item Is GridFilteringItem Then
        Dim filterItem As GridFilteringItem = TryCast(e.Item, GridFilteringItem)
        Dim DateOpened As RadDatePicker = DirectCast(filterItem("column1").Controls(0), RadDatePicker)
        DateOpened.Culture = New System.Globalization.CultureInfo("sv-SE", True)
    End If
End Sub

Also refer the following documentation
Specifying a Culture

Thanks,
Princy.
0
Hendrik
Top achievements
Rank 1
answered on 09 Feb 2011, 05:00 PM
sorry, forgot to say "thanks" that days... your hint was helpful to me :)

regards, hendrik
Tags
Grid
Asked by
Hendrik
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Hendrik
Top achievements
Rank 1
Share this question
or