I need a working example for swapping text after a selection has been made from a combobox in the ultragrid. I tried using a creation filter following: http://www.infragistics.com/community/forums/p/33419/182290.aspx#182290 but we have 1 in place for column merging already (http://www.infragistics.com/community/forums/t/59551.aspx).So this leaves me still trying to figure out why on earth the Cell.Text is readonly.
I tried to look at this: http://help.infragistics.com/Help/Doc/WinForms/2012.1/CLR2.0/HTML/Infragistics2.Win.v12.1~Infragistics.Win.UltraControlBase~DrawFilter.htmland: http://www.infragistics.com/community/forums/t/90661.aspx but I have no idea how to navigate through the UI Elements to find out which one my Row/Cell is so I can paint the value.
Enclosed is a code sample that I would like you to complete so I can try to implement this behavior in our product.
Also, how would I use a DrawFilter in a class that would use Cell Value to grab the text to paint? This might be self explanatory after seeing what you guys do.
Also, side question: Why on earth does the DrawFilter and CreationFilter fire on mouse move in the grid?
If you are trying to swap text with any values then using a dropdown list is recommended solution. By placing a dropdown list user can select between options and it can also act as a look up table to convert ID values into more user friendly text. Dropdown list also limits user to specific set of choices without permitting him to enter invalid values. You can refer to the below KB article to read more about this:
Using Infragistics UIElementViewer utility you can identify the corresponding UIElement for a Row/Cell. You can read about the UIElementViewer utility here:
I’m attaching the UIElementViewerUtility to this post as the download link at above site does not work and we are working on it.
Please let me know if I may be of further assistance.
Sincerely,Sahaja KokkalagaddaAssociate Software Developer
I think you miss understand me; I'm wanting to change what's rendered back from the dropdownlist (combobox). The text won't be the same from what's in the dropdownlist. In following this article: http://www.infragistics.com/community/forums/p/33419/182290.aspx#182290 it suggests it can be done. I'd like to know how.
What I want to do is combine a prefix to the text brought back. The sample I included was just to help figure out how. In the article I linked it mentioned using a DrawFilter or CreationFilter; we already have a CreationFilter assigned to the grid so that leaves a DrawFilter. Sadly, I cannot locate a code example anywhere in your help or forums that illustrates using one in the detail I need.
FYI the link on the website you sent me to doesn't work.
This won't work. Unless you can have 3 columns in the drop down, 2 hidden, pass back the desired text and Id, but display different text in the drop down. This is why I want to use a drawfilter.
I modified the previous sample to demonstrate how three columns can be added to UltraCombo dropdown. Two columns, Value member (PostalCode column) and Display member (Abbreviation column that is shown in the editor portion of control) being hidden and showing only Country name column in the drop down.
Please review it and let me know if you have any questions.
I realize that you responded to my issue with 3 columns, but when looking through the example there's a caveat; we are using a ValueList for the items and not a DataTable. We do not use ADO.Net on the UI. The reason for using a ValueList is because we use 2 different types of objects in the same list. Example: Apples and Oranges. Both are fruit but the properties are different.
How would I use a ValueList in your example?
I really do wish you would have just given me the drawfilter I asked for so I didn't have to lose over a week in development.
You can use UltraDropDown or UltraCombo instead of a ValueList. And you don't need ADO.Net. You can populate the list using an UltraDataSource.
A DrawFilter/CreationFilter is not a good solution here, because while you could change the displayed text in the ValueList, you would only be changing it at the rendering level. This means that the size of the ValueList would not know about the displayed text and it would end up clipped or with too much space, depending on whether you made the text longer or shorter.
Mike / Sahaja,
That works. The only reason we used a ValueList was because we were using 2 different types of objects and passing in each object as the DataValue parameter. This was done so we could pull the rest of the properties from the object after a selection was made.
I do appreciate the explanation on the DrawFilter. having never implemented one I wouldn't know the drawbacks.