Hey, I am in a merge of a windows project to silverlight, and I had a combobox usercontrol that displays a datagrid:
So, I have now a combobox with a SL datagrid like this:
and the code is:
public class MyComboBox : ComboBox { public MyComboBox() { DefaultStyleKey = typeof(MyComboBox); } Popup popup; DataGrid g; public override void OnApplyTemplate() { base.OnApplyTemplate(); popup = ((Grid) VisualTreeHelper.GetChild(this, 0)).FindName("Popup") as Popup; if (popup != null) g = ((Border)((Canvas)popup.Child).Children[1]).Child as DataGrid; g.SelectionChanged += g_SelectionChanged; g.MouseLeftButtonUp += g_MouseLeftButtonUp; }
void g_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { IsDropDownOpen = false; }
void g_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (e.AddedItems.Count == 0) SelectedIndex = 0; else SelectedItem = e.AddedItems[0]; } }
-----
So, I want to know if there is any way to do this with a XamWebGrid instead of DataGrid because I need to use the filtering feature, and then if it's possible use a infragistics combobox editor instead of a generic combobox.
Thanks in advance,
Paul.
Hi Paul,
What kind of problems are you having when you try to use the XamWebGrid?
As for using our ComboEditor, thats not going to be possible. As you're looking ore for a DropDown control, where as our XamWebComboEditor was made only for handling bound collections of data, specifically for type ahead, and filtering capabilities that the ms combobox lacked.
-SteveZ
Hi Stephen, well first I tried with the code I posted here, it works with the DataGrid because somehow the combobox has a DataGrid inside, but when I put there a xamwebgrid it doesn't work, so i was working with xaml templates without succed. Any ideas to achieve this?