6 Answers, 1 is accepted
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 30 Jan 2011, 07:00 PM
Hi Hasan,
In code:
See MSDN for Format String Info
In code:
dateColumn.FormatString =
"{0:d}"
See MSDN for Format String Info
In the Designer
- Go to the properties of the RadGridView
- Open the Columns collection editor
- Find or add your date time column
- Set the Format String to "{0:d}"
Hope that helps
Richard
EDIT: Note that you can also set the same information through the Smart Tag >> Open Property Builder
0
Hasan
Top achievements
Rank 1
answered on 06 Feb 2011, 12:45 PM
Thanks for the help. It is showing the correct date format but when I export the data in pdf it is still showing the date time format. How to fix that.
0
Richard Slade
Top achievements
Rank 2
answered on 06 Feb 2011, 08:57 PM
Hello,
Please have a look at the following forum post which explains formatting PDF date columns.
Hope that helps
Richard
Please have a look at the following forum post which explains formatting PDF date columns.
Hope that helps
Richard
0
Jennifer
Top achievements
Rank 1
answered on 11 May 2012, 04:32 PM
I have an unbound data grid that I fill with data. I also allow users to modify the data.
The columns I am interested in contain US currency and percentage. I have opened up the property builder and added the format {0:c} (and various others) to the FormatString property to get the deesired effects. I also tried setting the property in code as well; that didn't work either.
I cannot get the currency (or percentage) to display in the columns.
Can someone help me determine what I am doing wrong?
Thanks!
Bob
The columns I am interested in contain US currency and percentage. I have opened up the property builder and added the format {0:c} (and various others) to the FormatString property to get the deesired effects. I also tried setting the property in code as well; that didn't work either.
I cannot get the currency (or percentage) to display in the columns.
Can someone help me determine what I am doing wrong?
Thanks!
Bob
0
Bob
Top achievements
Rank 2
answered on 11 May 2012, 04:34 PM
Wrong email / Account - Sorry.
I have an unbound data grid that I fill with data. I also allow users to modify the data.
The columns I am interested in contain US currency and percentage. I have opened up the property builder and added the format {0:c} (and various others) to the FormatString property to get the deesired effects. I also tried setting the property in code as well; that didn't work either.
I cannot get the currency (or percentage) to display in the columns.
Can someone help me determine what I am doing wrong?
Thanks!
Bob
I have an unbound data grid that I fill with data. I also allow users to modify the data.
The columns I am interested in contain US currency and percentage. I have opened up the property builder and added the format {0:c} (and various others) to the FormatString property to get the deesired effects. I also tried setting the property in code as well; that didn't work either.
I cannot get the currency (or percentage) to display in the columns.
Can someone help me determine what I am doing wrong?
Thanks!
Bob
0
Hello,
Thank you for writing.
Here is a small example which demonstrates how to set the FormatString of a decimal column to both currency and percentage:
I hope this helps.
All the best,
Stefan
the Telerik team
Thank you for writing.
Here is a small example which demonstrates how to set the FormatString of a decimal column to both currency and percentage:
public
Form1()
{
InitializeComponent();
GridViewDecimalColumn col1 =
new
GridViewDecimalColumn(
"Currency"
);
col1.FormatString =
"{0:c}"
;
radGridView1.Columns.Add(col1);
GridViewDecimalColumn col2 =
new
GridViewDecimalColumn(
"Percentage"
);
col2.FormatString =
"{0:p}"
;
radGridView1.Columns.Add(col2);
for
(
int
i = 0; i < 10; i++)
{
radGridView1.Rows.Add(i * 3.14, (
double
)i/10);
}
}
I hope this helps.
All the best,
Stefan
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>