Width of the combobox
Hello,
I have a problem with a with of the control cell: GridComboBoxColumn
When shows the options cut the text.
I attached a file to see.
Can I set automatic width to show all text of the combo??
Thanks
Attachment: Captura_7c509852.rar
SIGN IN To post a reply.
3 Replies
SS
Susmitha Sundar
Syncfusion Team
May 6, 2020 01:10 PM UTC
Hi Mel,
Thank you for using Syncfusion controls.
You can achieve your requirement by three ways,
Way 1:
Set the GridComboBoxColumn’s width based on DropDown content size.
|
this.sfDataGrid1.Columns.Add(new GridComboBoxColumn() { MappingName = "Country", HeaderText = "Country",DataSource = collection, Width = 200 }); |
Way 2: You can view the entire text using DropDown size gripper.
Way 3
You can change the DropDown itemHeight based on content, by overriding the GridComboBoxCellRenderer class and setting the SfComboBox.DropDownListView.AutoFitMode as Height.
|
this.sfDataGrid1.CellRenderers.Remove("ComboBox");
this.sfDataGrid1.CellRenderers.Add("ComboBox", new GridComboBoxCellRendererExt());
public class GridComboBoxCellRendererExt : Syncfusion.WinForms.DataGrid.Renderers.GridComboBoxCellRenderer
{
protected override void OnInitializeEditElement(DataColumnBase column, RowColumnIndex rowColumnIndex, SfComboBox uiElement)
{
uiElement.DropDownListView.AutoFitMode = Syncfusion.WinForms.ListView.Enums.AutoFitMode.Height;
base.OnInitializeEditElement(column, rowColumnIndex, uiElement);
}
}
|
Sample link: https://www.syncfusion.com/downloads/support/forum/153974/ze/DataGrid_ItemHeight-244306230
Please check the sample and let us know if you need further assistance on this.
Regards,
Susmitha S
ME
Mel
May 6, 2020 02:43 PM UTC
Ok. Thanks
but are anyway to set with automatic based on the with of a components of combo?¿
Thanks
SS
Susmitha Sundar
Syncfusion Team
May 7, 2020 07:59 AM UTC
Hi Mel,
Thank you for the update.
No, we did not provide the support to modify the width of DropDown items. So we have provided the size gripper to view the entire text.
Please let us know if you need further assistance on this.
Regards,
Susmitha S
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
ME Mel
- May 5, 2020 04:33 PM UTC
- May 7, 2020 07:59 AM UTC