Thank you for contacting us.
You can access the editors in the CellEditorInitialized
event and change the TextAlignment
property to HorizontalAlignment.Center
. In order to achieve your goal, please have a look at the following code snippet:
sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
RadTextBoxEditor textEditor = e.ActiveEditor
GridSpinEditor spinEditor = e.ActiveEditor
GridSpinEditorElement el = spinEditor.EditorElement
el.TextAlignment = HorizontalAlignment.Center;
RadTextBoxEditorElement el = textEditor.EditorElement
el.TextAlign = HorizontalAlignment.Center;
The example demonstrates how to set the alignment of two editors (textbox editor and spin editor). If you use another editor in you application, you need to set their alignment too.
I also attached a sample demo.
Should you have further questions, I would be glad to help.
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.