Hello,
I'm new to your controls and WPF so for few days I tried to code something with XamlMultiColumComboEditor, and some problems has occurred.
1) How can I get a selected field, ie in a MessageBox, like MessageBox.Show(combobox.SelectedValue.ToString()); because SelectedValue is always null (I put this code in the SelectionChanged event of the control, that may be the reason) and others return me something I don't want and I don't understand.
2) Is it normal that I always have a blank column at the end of my rows ? If so, why, and (how) can I get rid of it properly ?
3) My control displays 3 columns from a dataset. Everything works well until I click on a row, then the text field displays only one value (the last one). Same question as above, but to display the whole row.
4) How can I change the name / title of headers ? They seem to take my database's fields' names, and I don't want that since it's camel cased but not really pretty.
Although this control (and some others) are really usefull, those problems are annoying me, but maybe I didn't search far enough...
And just to be curious : before I discovered Infragistics' controls, I tried to gather about 36 000 rows from my database in a combobox. It took so much time to initialize... and I was so impressed to see yours takes only... almost nothing ! How did you do that ? I struggled for a while to find a way to solve it !
Thanks for your help !
Hi Collin,
Here are the answers:
I would encourage you to take a look at the samples for this control so you get better feeling of it. Here's a link to the Silverlight samples for this control http://ko.infragistics.com/products/silverlight/multicolumn-combo. Don't mind it is Silverlight since the control is the same. You could find the samples for WPF if you got them installed. The SL ones are just more easy to reference here :)
Finally XamMultyColumnComboEditor is so much faster than the MS ComboBox because of the UI Virtualization it uses. So basically when you bind the editor to 30K rows when firstly opened the MS ComboBox generate a Control representing every single item so that's 30K UI items generated on opening even though only couple of them are visible at a single moment. The XamMultiColumnComboEditor creates just enough UI items only for the items that are currently visible.
Hope this helps,
Hello and thanks for your answer, it helped me in some ways.
I found and tried this code to get the selected text by users :
SpecializedTextBox tbV = Utilities.GetDescendantFromName(cbVille as DependencyObject, "TextBoxPresenter") as SpecializedTextBox;
It works, I'm able to display the selected field in a messagebox, but it looks pretty scary. Why do you do that, what is the purpose of a DependencyObject, and what is the difference between a SpecializedTextBox and a basic control ? Do I really need to do everything of this to get the clicked text ? And the main problem remains, it doesn't display the whole row. Even if it's not important in this project, I would like to know the reason, if I can fix it.
Not sure how I can use the selectedValuePath here since I don't have a class to bind my combobox, it is just filled thanks to a query and a dataset. Maybe by giving it one of the query's fields as a value ? Anyway, I see how it works, I tried it for another test project, but this one doesn't fit. Thanks for your link, I'll check it out.
You're right, I didn't unchecked the AutoGenerateColumns property as it worked well, and I had this idea too that it may have been because of that. The fact is I already checked the null value in my object (a query's result), and there's nothing about it inside. Even the header is empty. What is weird is that it occurs only sometimes. No reason, I just launch and re-launch my project and it happens or not. However, I wish I could have kept the AutoGenerateColumns property to true, since it's easier. So there may be a reason about that ?
Ok thanks for your tips, I think I got it, but it's only if I set my columns by myself, and I would like to avoid to do that when it can do it for me.
Another problem has occurred though : I wanted to clear my combobox (the same as above), but cb.Items.Clear() doesn't seem to work. Any reason ? I then tried to read through the Items list with a foreach loop like that :
foreach (Infragistics.Controls.Editors.ComboRow item in cbRSociale.Items)
{
MessageBox.Show(item.ToString());
}
And... I only get "Infragistics.Controls.Editors.ComboRow". I suppose I can't cast it to a string because the row can contain anything like an image, ok, my bad. But what if I want to check a combobox filled of strings (ie with only one field per row) ? Can't I set a value to a field for each row ? Anyway, the main question is : how can I clear my combobox ?
Your controls seem to be very very different from MS's, it's painful sometimes even if it's magic the first time. Any reason about that ? Besides the rapidity to deal with 30 000 rows haha !
Well, thanks a lot for your help !