User (Old forums)MemberMay 9, 2010 at 7:17 amPost count: 23064
I am making some tries on the layout of your controls using your trial.
In order to space my grid’s rows content more than default, I increased the “Height” in the Datarowtemplate and set the “VerticalAlignment” to “center”.
This works fine. Data are showed at the center of the row and rows are taller, with the effect of more “breathe” between rows.
The problem is when the user enter “editmode” in a cell. The text get vertical aligned to the top, I suppose that’s because of the default vertical alignment in the associated editor. Although I did not notice a “VerticalAlignment” property to change for the editor content.
How can I center the editors content VerticalAlignment? Or is there another way to have more “breathe” between rows?
I need to know that I can apply a basic layout variant to your controls without too much trouble before buying.
Thank you for your courtesy
Imported from legacy forums. Posted by F. (had 974 views)Xceed SupportMemberMay 20, 2010 at 4:10 pmPost count: 5658
To keep the content vertically centered even in edition, you could use the following code sample.
public partial class Form1 : Form
Xceed.Grid.Licenser.LicenseKey = “”;
Column column0 = new Column(“Test”, typeof(string));
this.grid.DataRowTemplate.Height = 50;
this.grid.DataRowTemplate.OverrideUIStyle = true;
this.grid.DataRowTemplate.VerticalAlignment = VerticalAlignment.Center;
CellEditorManager cellEditorManager = this.grid.Columns[“Test”].CellEditorManager;
WinTextBox winTextBox = cellEditorManager.TemplateControl as WinTextBox;
cellEditorManager.QueryEditorBounds += new QueryEditorBoundsEventHandler(cellEditorManager_QueryEditorBounds);
for (int i = 0; i < 100; ++i)
Xceed.Grid.DataRow row = this.grid.DataRows.AddNew();
row.Cells[“Test”].Value = i.ToString();
void cellEditorManager_QueryEditorBounds(object sender, QueryEditorBoundsEventArgs e)
TextEditor textEditor = sender as TextEditor;
e.Bounds = new Rectangle(e.Bounds.X, e.Bounds.Y + (e.Bounds.Height – ((WinTextBox)e.Control).TextBoxArea.PreferredHeight) / 2, e.Bounds.Width, e.Bounds.Height);
Imported from legacy forums. Posted by Mohamed [Xceed] (had 1068 views)
- You must be logged in to reply to this topic.