8 Answers, 1 is accepted
What version of the controls are you using?
if you are using an older version, could you please try the following code..
Private Sub combo_DropDownOpened(ByVal sender As Object, ByVal e As EventArgs)
Dim combo As RadMultiColumnComboBox = DirectCast(sender, RadMultiColumnComboBox)
combo.EditorControl.GridElement.VScrollBar.Value = 0
combo.EditorControl.Rows(combo.EditorControl.Rows.Count - 1).EnsureVisible()
End Sub
Let me know if this isn't helping
Richard
Please just try setting the AutoSizeDropDownToBestFit property to true and please let me know if this solved your problem.
Hope this helps, if you have any other questions or comments, please let me know,
Best Regards,
Emanuel Varga
You are not bothering me, I'm always glad to help.
And as always, if you have any other questions or comments, please let me know,
Best Regards,
Emanuel Varga
Hi,
I am using this property for best fit my column(objComboBox.MultiColumnComboBoxElement.AutoSizeDropDownToBestFit =
true;) in RadMultiColumnComboBox columns but when i have data source which have a lot of data i need to implement filtering on it.
I am implemening it in this way:
FilterDescriptor filter = new FilterDescriptor();
filter.PropertyName = objComboBox.DisplayMember;
filter.Operator =
FilterOperator.Contains;
objComboBox.EditorControl.MasterTemplate.FilterDescriptors.Add(filter);
but it's take a lot of time when the filter is auto complete.
Please how to make filtering in this controll and dont take a time.
Note: When i am not using AutoSizeDropDownToBestFit it's( Filter) works fine and i dont have delay( my data source have more then 1000 items and 3 columns), but when i have Combo which have more then 3 column and the size of DropDown is less, than the user can not see what have in that control.
What is your suggestion to eliminate this issue.
Best regards,
Gezim
Updated:22.06.2012
I have reply from Telerik Team, thanks for all.
Best regards,
Gezim
Yes, your observation is correct. RadMultiColumnComboBox is opening its drop down window slowly, because of the AutoSizeDropDownToBestFit property. When it is set to true, RadMultiColumnComboBox calculates the width of all cells in order to determine the optimal width. In case when there are many rows or columns in the grid, this can be a slow process.
When you want to speed up this process, you could call the BestFitColumns method:
this
.radMultiColumnComboBox1.ValueMember =
"ID"
;
this
.radMultiColumnComboBox1.DisplayMember =
"Name"
;
this
.radMultiColumnComboBox1.DataSource = table;
this
.radMultiColumnComboBox1.AutoSizeDropDownToBestFit =
false
;
this
.radMultiColumnComboBox1.BestFitColumns(
true
,
false
);
Svett
the Telerik team
Thanks a lot for reply. This that you have postet halps me a lot(i have traied already) but the user can not see the column header text and for that i am not applaing this property(only in those LookUp combo where i have a lot of data).
I am waiting from you elmanifice gays to optimaize this property to work.
I have done one solution, and i am using it.
when i will call the method to fill my Combo i am passing the optional parameter where i want to not call this property.
The code below do that>
public
static
DataSet FillRadLookUpEdit(Telerik.WinControls.UI.RadMultiColumnComboBox objComboBox,
string
SqlQuery,
int
KeyColumn, DataSet Dataset,
bool
AutoSizeDropDownToBestFit =
true
)
{
Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
DataSet Sqlds =
default
(DataSet);
if
(Dataset ==
null
)
{
Sqlds =
new
DataSet();
SqlDataAdapter Sqlda =
new
SqlDataAdapter();
Sqlda.SelectCommand =
new
SqlCommand(SqlQuery, Database.CheckConn());
Sqlda.SelectCommand.CommandTimeout = 0;
Sqlda.Fill(Sqlds,
"SqlResult"
);
}
else
{
Sqlds = Dataset;
}
objComboBox.DataSource = Sqlds.Tables[0];
objComboBox.ValueMember = Sqlds.Tables[0].Columns[0].Caption;
objComboBox.DisplayMember = Sqlds.Tables[0].Columns[KeyColumn].Caption;
objComboBox.SelectedIndex = -1;
objComboBox.MultiColumnComboBoxElement.DropDownWidth = -1;
objComboBox.MultiColumnComboBoxElement.AutoSizeDropDownToBestFit = AutoSizeDropDownToBestFit;
//As you can seee i am using this optionals parameter
if
(AutoSizeDropDownToBestFit) objComboBox.MultiColumnComboBoxElement.BestFitColumns();
//objComboBox.MultiColumnComboBoxElement.BestFitColumns(true, false);
objComboBox.AutoFilter =
true
;
objComboBox.MultiColumnComboBoxElement.AutoFilter =
true
;
FilterDescriptor filter =
new
FilterDescriptor();
filter.PropertyName = objComboBox.DisplayMember;
filter.Operator = FilterOperator.Contains;
objComboBox.EditorControl.MasterTemplate.FilterDescriptors.Add(filter);
}
And as you can see i am passing one optional parameter on the method and depens on which controll i am using i pass it.
Example of calling>
GvGrid.FillRadLookUpEdit(cmbClientFilter,
"dbo.List_Partners '"
+ Maintenance.DefaultCulture +
"', '"
+ Maintenance.CurrentCulture +
"', '"
+ Database.CurrentUser +
"'"
, 1,
null
,
false
);
GvGrid.FillRadLookUpEdit(cmbCurrency,
"dbo.List_Currencies_Lkp '"
+ Maintenance.DefaultCulture +
"', '"
+ Maintenance.CurrentCulture +
"', '"
+ Database.CurrentUser +
"'"
, 0,
null
);
Best regards,
Gezim from Kosova