RadNumericTextBox controls contains DecimalSeparator and GroupSeparator properties in NumberFormateSettings collection. But these properties are not available in RadGrid's GridNumericColumn. Unfortunately GridNumericColumn's DataFormatString property also not working correctly. How can I achieve these properties behaviour in GridNumericColumn? (Even I'm ready to develop CustomRadGrid control also.)
7 Answers, 1 is accepted

please check below code snippet for set such type of property.
<
telerik:GridNumericColumn
DataField
=
"ID"
HeaderText
=
"ID"
UniqueName
=
"ID"
></
telerik:GridNumericColumn
>
protected
void
RadGrid1_ItemDataBound(
object
sender, Telerik.Web.UI.GridItemEventArgs e)
{
if
(e.Item.IsInEditMode && e.Item
is
GridEditableItem)
{
GridEditableItem item = e.Item
as
GridEditableItem;
RadNumericTextBox RadNumericTextBox1 = item[
"ID"
].Controls[0]
as
RadNumericTextBox;
// set your property here
}
}
Let me know if any concern.
Thanks,
Jayesh Goyani

Thanks for your reply. Actually my grid is not in edit mode (its in display mode only). And also I'm not using RadNumericTextBox inside the grid. I'm only using GridBoundColumn and GridNumericColumn columns.
RadGrid1 is like this
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
Width
=
"100%"
AutoGenerateColumns
=
"false"
AllowFilteringByColumn
=
"true"
AllowSorting
=
"true"
AllowPaging
=
"true"
PageSize
=
"3"
>
<
MasterTableView
DataKeyNames
=
"Id"
TableLayout
=
"Fixed"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"Id"
HeaderText
=
"Id"
Resizable
=
"false"
UniqueName
=
"Guid"
Visible
=
"true"
>
<
telerik:GridNumericColumn
DataField
=
"Salary"
HeaderText
=
"Salary"
Resizable
=
"false"
UniqueName
=
"Salary"
Visible
=
"true"
>
</
telerik:GridNumericColumn
></
Columns
></
MasterTableView
></
telerik:RadGrid
>
On the above Numeric Column I want to apply DecimalSeperator and GroupSeperator functionalities.
If I able to achieve above functionality then I will expose these two properties in my Custom Grid and that functionality I will incorporate in customRadGrid itself (we require same functionality in many places thats why making CustomRadGrid.) And all my control users just set these two properties as per their need like below
<
mytelerik:myRadGrid
ID
=
"myRadGrid1"
runat
=
"server"
Width
=
"100%"
AutoGenerateColumns
=
"false"
AllowFilteringByColumn
=
"true"
AllowSorting
=
"true"
AllowPaging
=
"true"
PageSize
=
"3"
>
<
MasterTableView
DataKeyNames
=
"Id"
TableLayout
=
"Fixed"
>
<
Columns
>
<
mytelerik:myGridBoundColumn
DataField
=
"Id"
HeaderText
=
"Id"
Resizable
=
"false"
UniqueName
=
"Guid"
Visible
=
"true"
>
<
mytelerik:myGridNumericColumn
DecimalSeparator
=
","
GroupSeparator
=
" "
DataField
=
"Salary"
HeaderText
=
"Salary"
Resizable
=
"false"
UniqueName
=
"Salary"
Visible
=
"true"
>
</
mytelerik:myGridNumericColumn
>
</
Columns
>
</
MasterTableView
>
</
mytelerik:myRadGrid
>
Any way this CustomGrid is secondary, first of all I'm unable to achieve Decimalseparator and GroupSeparator functionality on GridNumericColumn (in display mode only not in edit mode). Any suggestions are appreciated.

Hello,
I have the same problem as described above. I want radGrid column to display the numeric values with a specific decimal and group separator in display mode.
Did you find any solutions to the above problem?
Thanking you in advance.
Please try the following approach:
<
telerik:GridNumericColumn
...
DataFormatString
=
"{0:##,#0.000}"
>
For additional customization, please refer to the following topic:
http://msdn.microsoft.com/en-us/library/0c899ak8.aspx
I hope this will prove helpful. Please give it a try and let me know about the result.
All the best,
Eyup
the Telerik team

<
telerik:GridNumericColumn
...
DataFormatString
=
"{0:##,#0.000}"
>
The above dataformatString
"{0:##,#0.000}"
displays the value 123456789.5678 as 123,456,789.568 in english culture.
But I want my column to display my specific decimal and group separator.
For example, I have set “*” as decimal separator and “@” as group separator, my grid column should display 123@456@789*568
I read that GridNumericColumn has RadNumericTextBox in edit mode. I can set RadNumericTextBox’s decimal and group separator to edit my value.
Do you have any solutions to display and edit my decimal value in grid according to my decimal separator “*” and group separator “@”?
Thanks for the reply.
In this case you will need to access the auto-generated RadNumericTextBox in edit mode and modify the cell text in regular view. Please try the following approach:
protected
void
RadGrid1_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridEditableItem && e.Item.IsInEditMode)
{
GridEditableItem editItem = e.Item
as
GridEditableItem;
RadNumericTextBox numBox = editItem[
"Freight"
].Controls[0]
as
RadNumericTextBox;
numBox.NumberFormat.GroupSeparator =
"@"
;
numBox.NumberFormat.DecimalSeparator =
"*"
;
}
else if
(e.Item
is
GridDataItem)
{
GridDataItem dataItem = e.Item
as
GridDataItem;
GridTableCell cell = dataItem[
"Freight"
]
as
GridTableCell;
string
formattedNumber =
string
.Format(
"{0:##,#0.000}"
,
decimal
.Parse(cell.Text),
System.Globalization.CultureInfo.InvariantCulture);
cell.Text = formattedNumber.Replace(
','
,
'@'
).Replace(
'.'
,
'*'
);
}
}
That should do the trick. Please try it out and let me know if it helps you.
Regards,
Eyup
The Telerik Team

Your solution worked well.
Thanks for the reply.