Windows XP Pro / NetAdvantage 7.1.20071.40 / Windows Forms Application / .Net 2.0 / C#
I am looking to have a grid cell display a UltraDropDown control. I want the drop down to display a sequence of years which can be selected or unselected (ideally using multi select).
The list starts off with every year within a range being selected. The WinGrid cell display for this is 'startYear - endYear' where startYear and endYear are the bounds of the range - ie. "1960 - 2006".
The user wants to be able to click in the WinGrid on that cell and have all the years from 1960 to 2006 show up in a drop down box. They can then unselect years. When the user finishes unselecting the year(s), the UltraGrid cell will display with a yellow background to signify the range "1960 - 2006" is non-continious. The user also wants the dropdown to have a visual indication of which year(s) are un-selected. I suspect the best way to do this is to have two columns to display in the dropdown, one with the year, the other with 'isSelected' indication.
I have been able to make the cell contain a DropDownList which unfortunately contains only the years. (I do this by setting the column style to DropDownList - but this does not allow two columns to be displayed (ie a 'isSelected' status), and I have not been able to get a multi-select functionallity from the DropDownList.)
I am figuring the UltraDropDown can be used inside a WinGrid cell and can be used to display the year and its 'isSelected' status.
Can anyone show me a way set the column to display the UltraDropDown? I have studied the 'Per Cell ValueList and Editors' sample provided by IG.
Follow-up questions:
1. Is it possible to make the cell's control a multi-select ultraDropDown? - I do have a class possessing properties 'year' and 'isSelected'.
2. Any suggestions on how to retain the "1960 - 2006" display in the WinGrid cell, even when the user has selected / unselected years?
Gary
Those articles are obsolete, anyway. Unless you are using a very old version of the controls. Both UltraCombo and UltraComboEditor now have built-in support for multi-select.
These articles will show you how to set up multi-select for UltraComboEditor or UltraCombo:
https://es.infragistics.com/help/winforms/wincomboeditor-selecting-multiple-values-within-wincomboeditor
https://es.infragistics.com/help/winforms/wincombo-selecting-multiple-values-within-wincombo
The link for the article does not seem to work. Could you provide another link?
Matt's reply here was correct at the time, but we have since added multi-select support to the various dropdown controls.
So if you have a fairly new version of NetAdvantage, you should check out the documentation for UltraCombo or UltraComboEditor (depending on which one you want to use) and implementing multi-select is now a lot easier than it was.
If you have an old version of the controls and cannot update, then I think we would need to see a sample of what you are doing so we can determine what's wrong. You can post a small sample project here by going to the Options tab when replying.
i have created as show in KB article,
but value selected in first row changes, while selecting value for second row
and multiselectgrid shows same value for all rows.
need to have individual row selected items in multiselectgrid.
and also needed to autocomplete in the grid column
Matt
Thanks for the information. the KB link you provided, coupled with your comments on overriding the ToString method is right on.
Comments to others - the KB does a good job of describing the how and why of building a custom dropdown list that can be displayed in the grid. I made the textbox, popup button, and secondary grid into a UserControl and it works very nicely.