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);
}
}
|
Please check the sample and let us know if you need further assistance on this.
Regards,
Susmitha S