in aspx file:
...
<telerik:RadGrid
ID="grdList" runat="server"
EnableViewState="false"
Height="328px"
AllowPaging="true"
AllowSorting="true"
AllowFilteringByColumn="true"
AutoGenerateColumns="False"
PageSize="12"
Skin="WebBlue">
<MasterTableView ClientDataKeyNames="Col1" EnableViewState="False">
<Columns>
<telerik:GridBoundColumn DataField="Col1"
HeaderText="COL1" Visible="false">
<HeaderStyle Width="80px" HorizontalAlign="left" />
<ItemStyle Width="80px" HorizontalAlign="left" />
</telerik:GridBoundColumn>
...
in aspx.cs file => Page_Load:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
...
GridBoundColumn col;
col = (GridBoundColumn)grdList.MasterTableView.Columns[i];
col.HeaderText = colHdrs[i];
// colDataTypes[i].Equals array containing "date" or "string" or ...
if (colDataTypes[i].Equals("date"))
{
col.DataType = Type.GetType("System.DateTime");
col.DataFormatString = "{0:MM/dd/yyyy}";
}
col.Visible = true;
...
}
}
I tried different values for DataFormatString and it always displays long date time format
when i set to bogus value: [0:MM/dd/yyyy] => all rows displayed the string [0:MM/dd/yyyy]
So i know the DataFormatString is being set for date column.
                                ...
<telerik:RadGrid
ID="grdList" runat="server"
EnableViewState="false"
Height="328px"
AllowPaging="true"
AllowSorting="true"
AllowFilteringByColumn="true"
AutoGenerateColumns="False"
PageSize="12"
Skin="WebBlue">
<MasterTableView ClientDataKeyNames="Col1" EnableViewState="False">
<Columns>
<telerik:GridBoundColumn DataField="Col1"
HeaderText="COL1" Visible="false">
<HeaderStyle Width="80px" HorizontalAlign="left" />
<ItemStyle Width="80px" HorizontalAlign="left" />
</telerik:GridBoundColumn>
...
in aspx.cs file => Page_Load:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
...
GridBoundColumn col;
col = (GridBoundColumn)grdList.MasterTableView.Columns[i];
col.HeaderText = colHdrs[i];
// colDataTypes[i].Equals array containing "date" or "string" or ...
if (colDataTypes[i].Equals("date"))
{
col.DataType = Type.GetType("System.DateTime");
col.DataFormatString = "{0:MM/dd/yyyy}";
}
col.Visible = true;
...
}
}
I tried different values for DataFormatString and it always displays long date time format
when i set to bogus value: [0:MM/dd/yyyy] => all rows displayed the string [0:MM/dd/yyyy]
So i know the DataFormatString is being set for date column.