Changing texts in GridDateTimeColumn filter in Telerik Radgrid
I think Google Translate is used in the Turkish translation of Telerik Radgrid, so when choosing between two dates, the text From and To is written next to the datepicker. This creates an absurd image. The following code is functionally working to fix this issue.
Private Sub RadGrid1_ItemCreated(sender As Object, e As GridItemEventArgs) Handles RadGrid1.ItemCreated
Dim filterItem As GridFilteringItem = TryCast(e.Item, GridFilteringItem)
If filterItem IsNot Nothing Then
For Each filter As Telerik.Web.UI.GridTableCell In filterItem.Cells
If filter.Column.DataType() Is GetType(System.DateTime) Then
TryCast(filterItem(filter.Column.UniqueName).Controls(0), LiteralControl).Text = "Başlangıç: "
TryCast(filterItem(filter.Column.UniqueName).Controls(3), LiteralControl).Text = "Bitiş: "
End If
Next
End If
End Sub
private void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
GridFilteringItem filterItem = e.Item as GridFilteringItem;
if (filterItem != null)
{
foreach (Telerik.Web.UI.GridTableCell filter in filterItem.Cells)
{
if (filter.Column.DataType() == typeof(System.DateTime))
{
filterItem(filter.Column.UniqueName).Controls(0) as LiteralControl.Text = "Başlangıç: ";
filterItem(filter.Column.UniqueName).Controls(3) as LiteralControl.Text = "Bitiş: ";
}
}
}
}