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

DataFormatString for Auto Generated Columns

1 Answer 85 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Henry Derstine
Top achievements
Rank 1
Henry Derstine asked on 25 Aug 2008, 05:50 PM
Is there a way to set the dateformatstring for an auto generated column? I looked in the column created event but I do not see any options under e.column.
Essentially I am bringing in 5 fields all are auto generated but I need to format a date field.

Thanks

1 Answer, 1 is accepted

Sort by
0
Henry Derstine
Top achievements
Rank 1
answered on 25 Aug 2008, 05:59 PM
Nevermind-I figured out the proble.
FYI-

Protected

Sub radGridResults_ColumnCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridColumnCreatedEventArgs) Handles radGridResults.ColumnCreated

Select

Case e.Column.UniqueName.ToUpper
    Case "EXPDATE"
        Dim boundColumn As Telerik.Web.UI.GridBoundColumn = CType(e.Column, Telerik.Web.UI.GridBoundColumn)
        boundColumn.DataFormatString =
"{0:d}"
        e.Column.HeaderText = "Expiration Date"
            .
            .
            .
    Case Else
        e.column.visible=false

End Sub

Tags
Grid
Asked by
Henry Derstine
Top achievements
Rank 1
Answers by
Henry Derstine
Top achievements
Rank 1
Share this question
or