I have a multicolumn combobox. on the first time click of the combobox the sizing is not correct, it doesn't render itself properly and all the details are not visible.
but when you type some search text in auto filter text box, it does auto size it properly and all the text is visible.
please have a look @ screen shot attached.
regards,
Khizar
5 Answers, 1 is accepted
You can get to the Grid section of the Combo via the editor control. In this way, you can call teh BestFitColumns method as below
AddHandler
Me
.RadMultiColumnComboBox1.DropDownOpened,
AddressOf
RadMultiColumnComboBox1_DropDownOpened
Private
Sub
RadMultiColumnComboBox1_DropDownOpened(
ByVal
sender
As
Object
,
ByVal
e
As
EventArgs)
Me
.RadMultiColumnComboBox1.EditorControl.BestFitColumns()
End
Sub
Hope that helps but let me knw if you have further questions
Richard
I have given the code below for your reference:
this.rComboBoxImInvoiceTypes.AutoSizeDropDownToBestFit = true;
this.rComboBoxImInvoiceTypes.DataSource = InvoiceTypes;
this.rComboBoxImInvoiceTypes.DropDownOpened += new EventHandler(rComboBoxImInvoiceTypes_DropDownOpened); FilterDescriptor filter = new FilterDescriptor();
filter.PropertyName = this.rComboBoxImInvoiceTypes.DisplayMember;
filter.Operator = FilterOperator.StartsWith;
this.rComboBoxImInvoiceTypes.EditorControl.MasterTemplate.FilterDescriptors.Add(filter);
this.rComboBoxImInvoiceTypes.EditorControl.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
this.rComboBoxImInvoiceTypes.AutoFilter = true;
this.rComboBoxImInvoiceTypes.MultiColumnComboBoxElement.AutoCompleteMode = AutoCompleteMode.Suggest;
this.rComboBoxImInvoiceTypes.DropDownStyle = RadDropDownStyle.DropDown;
void rComboBoxImInvoiceTypes_DropDownOpened(object sender, EventArgs e)
{
this.rComboBoxImInvoiceTypes.EditorControl.BestFitColumns();
}
I would suggest setting a min size for the table element of the internal grid.
this
.rComboBoxImInvoiceTypes.EditorControl.TableElement.MinSize =
new
Size(300, 200);
hope that helps, but let me know if you need further information
Richard
When the AutoSizeDropDownToBestFit property is set to true you do not have to set the AutoSizeColumnsMode to Fill and call the BestFitColumns method. I slightly modified your code and was not able to observe the issue:
rComboBoxImInvoiceTypes.AutoSizeDropDownToBestFit =
true
;
rComboBoxImInvoiceTypes.DataSource = InvoiceTypes;
FilterDescriptor filter =
new
FilterDescriptor();
filter.PropertyName =
"Value"
;
filter.Operator = FilterOperator.IsGreaterThan;
rComboBoxImInvoiceTypes.EditorControl.MasterTemplate.FilterDescriptors.Add(filter);
rComboBoxImInvoiceTypes.AutoFilter =
true
;
rComboBoxImInvoiceTypes.MultiColumnComboBoxElement.AutoCompleteMode = AutoCompleteMode.Suggest;
rComboBoxImInvoiceTypes.DropDownStyle = RadDropDownStyle.DropDown;
Could you please confirm that this solves the issue? If not, send me your application and I will try to find the best option.
I am looking forward to your reply.
All the best,
Jack
the Telerik team