When i set SelectedItem back to MultiColumnComboBox programmatically, if the selectedItem is below the top items, not in view, the control cannot auto scroll to the right position,so could you expose a ScrollIntoView method.
4 Answers, 1 is accepted
0
Hello Huan,
Even though by default the dropdown element for the RadMultiColumnComboBox is a RadGridView, we would like to enable users to define their own dropdown content which could be any control. With this said, exposing a ScrollIntoView method for the RadMultiColumnComboBox may not make sense in all use cases.
Thus, what I can suggest is to get ahold of the RadGridView instance by utilizing the ChildrenOfType extension method or via the DropDownContentManager.DropDownElement property of the combo box and then call the ScrollIntoView method of the respective instance. Please note that in both cases the combo box should be opened prior to this operation so that the RadGridView is loaded.
Please let me know whether this would work for you or if you require any further assistance with the specific implementation.
Regards,
Dilyan Traykov
Progress TelerikWant to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Even though by default the dropdown element for the RadMultiColumnComboBox is a RadGridView, we would like to enable users to define their own dropdown content which could be any control. With this said, exposing a ScrollIntoView method for the RadMultiColumnComboBox may not make sense in all use cases.
Thus, what I can suggest is to get ahold of the RadGridView instance by utilizing the ChildrenOfType extension method or via the DropDownContentManager.DropDownElement property of the combo box and then call the ScrollIntoView method of the respective instance. Please note that in both cases the combo box should be opened prior to this operation so that the RadGridView is loaded.
Please let me know whether this would work for you or if you require any further assistance with the specific implementation.
Regards,
Dilyan Traykov
Progress TelerikWant to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Huan jia
Top achievements
Rank 1
Iron
answered on 14 Mar 2019, 01:51 AM
Hi, Dilyan
As you said, combo box should be opened prior to this operation so that the RadGridView is loaded.
But RadMultiColumnComboBox don't have a DropDownOpened Event as "System.Windows.Controls.ComboBox" does, And what i mean is to add a ScrollIntoView method to GridViewItemsSourceProvider class, not to RadMultiColumnComboBox class.
0
Accepted
Hi Huan,
We've designed the GridViewItemsSourceProvider to be easily definable in XAML and we would like to avoid exposing any of RadGridView's methods through it and polluting the class' API unless really necessary.
Exposing a DropDownOpened event for the RadMultiColumnComboBox, however, seems reasonable and I have thus logged the following feature request on your behalf regarding this.
For the time being, however, you can handle the RadDropDownButton.DropDownOpenedEvent event instead, like so (where mccb is a reference to your RadMultiColumnComboBox):
Please let me know whether this would work for you.
Regards,
Dilyan Traykov
Progress TelerikWant to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
We've designed the GridViewItemsSourceProvider to be easily definable in XAML and we would like to avoid exposing any of RadGridView's methods through it and polluting the class' API unless really necessary.
Exposing a DropDownOpened event for the RadMultiColumnComboBox, however, seems reasonable and I have thus logged the following feature request on your behalf regarding this.
For the time being, however, you can handle the RadDropDownButton.DropDownOpenedEvent event instead, like so (where mccb is a reference to your RadMultiColumnComboBox):
this.mccb.AddHandler(RadDropDownButton.DropDownOpenedEvent, new RoutedEventHandler(Button_DropDownOpened));
private
void
Button_DropDownOpened(
object
sender, RoutedEventArgs e)
{
this
.mccb.Dispatcher.BeginInvoke(
new
Action(() =>
{
(
this
.mccb.DropDownContentManager.DropDownElement
as
RadGridView).ScrollIndexIntoView(15);
}));
}
Please let me know whether this would work for you.
Regards,
Dilyan Traykov
Progress TelerikWant to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Huan jia
Top achievements
Rank 1
Iron
answered on 18 Mar 2019, 05:57 AM
Yes Dilyan
Your solution worked for me, problem solved, thank you.