We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Column Alignment in a dbGrid Combo Field

Thread ID:

Created:

Updated:

Platform:

Replies:

3856 Apr 14,2003 12:07 PM UTC Apr 14,2003 02:56 PM UTC Windows Forms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On April 14, 2003 12:07 PM UTC

When the value is a numeric one and I am mapping it to a string for display in a combo box the display is always right justified. I even tried setting the HorizontalAlignment to GridHorizontalAlignment.Left. on the columnstyle and it still show up wrong. myGrid.Model.ColStyles["column1"]..HorizontalAlignment = GridHorizontalAlignment.Left;

Administrator [Syncfusion]
Replied On April 14, 2003 02:56 PM UTC

If your grid is a GridDataBoundGrid, then use either the GridBoundColumns (if you explicitly added them) or Binder.InternalColumns to set this value.
//set up the comboboxes
GridStyleInfo style = this.gridDataBoundGrid1.Binder.InternalColumns["masterComboCol"].StyleInfo;
style.DataSource = GetTheMasterTable();
style.DisplayMember = "masterdesc";
style.ValueMember = "id";
style.BackColor = Color.LightBlue;
style.CellType = "ComboBox";
style.HorizontalAlignment = GridHorizontalAlignment.Left;

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;