Product Bundles
DevCraft
All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
Web
Mobile
Document Management
Desktop
Reporting
Testing & Mocking
CMS
UI/UX Tools
Debugging
Free Tools
Support and Learning
Productivity and Design Tools
i want format numeric data in PropertyGrid - item.value and editor.value. For example: value: 100000 formated value: 100 000 How can i do this? Can i use FormatString like "#,###"? Greetings Marek
public
Form1()
{
InitializeComponent();
MyObject ob =
new
MyObject();
ob.Number = 100000;
radPropertyGrid1.SelectedObject = ob;
radPropertyGrid1.ItemFormatting +=
Telerik.WinControls.UI.PropertyGridItemFormattingEventHandler(radPropertyGrid1_ItemFormatting);
radPropertyGrid1.EditorInitialized +=
Telerik.WinControls.UI.PropertyGridItemEditorInitializedEventHandler(radPropertyGrid1_EditorInitialized);
}
void
radPropertyGrid1_EditorInitialized(
object
sender, Telerik.WinControls.UI.PropertyGridItemEditorInitializedEventArgs e)
PropertyGridSpinEditor editor = e.Editor
as
PropertyGridSpinEditor;
if
(editor !=
null
)
editor.ThousandsSeparator =
true
;
radPropertyGrid1_ItemFormatting(
sender, Telerik.WinControls.UI.PropertyGridItemFormattingEventArgs e)
(e.Item.Name ==
"Number"
((PropertyGridItemElement)e.VisualElement).ValueElement.Text =
string
.Format(
"{0:#,###}"
, ((PropertyGridItem)e.Item).Value);
class
MyObject
int
Number {
get
set
; }