Hello-
This post, even though it's old, suggests what I'd like to do should be possible:http://forums.infragistics.com/forums/p/5107/23272.aspx#23272
I've got an UltraGrid with two columns.
Column 0 is a UltraCombo loaded with a ValueList.Column 1 is a TextBox.
What I'd like to do is set the NullText property of column 1 whenever the value of column 0 changes.
Using that post above as a model, I've attached a new editor to the cell in column 1 as follows:
UltraTextEditor editor = new UltraTextEditor();((ISupportInitialize)editor).BeginInit();editor.NullText = "This is NullText";((ISupportInitialize)editor).EndInit();cell.EditorComponent = editor;
Unfortunately, "This is NullText" never displays even though the underlying value in column 1 is in fact null.
NOTE: "This is NullText" is just a test for this post. What I need to do eventually is assign editor.NullText a value that is associated with the value chosen from the dropdown in column 0.
First, although the above post SUGGESTS this is possible, is what I need to do possible?
If so, what have I done wrong with my code or how should this be handled differently?
Thank you.
Hi Robert,
RobertSL said: For any followers of this thread here is what I found out and what I'll use to close this thread. What I originally wanted to do cannot be done - there just is no way to RELIABLY handle this. The suggestions offered above only sort of work in a very small subset of variations. If you use the suggestions offered, you'll get about 50% of the way there. The remaining 50% is an exercise in frustration. I gave up and ultimately resorted to writing a popup window whenever Cell0 changes. It is hardly ideal but the grid just doesn't work for this in any sort of clean and reliablle fashion. Maybe it isn't supposed to; I have no way to know.
For any followers of this thread here is what I found out and what I'll use to close this thread.
What I originally wanted to do cannot be done - there just is no way to RELIABLY handle this. The suggestions offered above only sort of work in a very small subset of variations. If you use the suggestions offered, you'll get about 50% of the way there. The remaining 50% is an exercise in frustration.
I gave up and ultimately resorted to writing a popup window whenever Cell0 changes. It is hardly ideal but the grid just doesn't work for this in any sort of clean and reliablle fashion. Maybe it isn't supposed to; I have no way to know.
I am sorry you are finding this so frustrating. But I am pretty confident that the CreationFilter approach I suggested will work if done properly. CreationFilters can be tricky, though, especially if you are not familiar with working with UIElements and the Infragistics PLF.
I did ask you what part of this you were having trouble with and never got a reply. I would be happy to continue to work with you on this and get it working.
If you could post a sample with whatever you have in your CreationFilter so far, I will take a look at it and see if I can point you in the right direction.
Or if it would help, I could whip up a small sample demonstrating the technique I was describing. The problem with my creating a sample, though, is that my sample probably won't match your real app, so it might not help.
RobertSL said:The bug reported above appears to be dead and has been inactive in IG Development since it was logged so I'm guessing it's been abandoned. In the unlikely event it actually gets addressed, I'll post the results here.
This bug has not been abandoned, but we are currently focusing a lot of our energy on the release of NetAdvantage 2010 Volume 3. So we have not gotten to it yet. :)
The bug reported above appears to be dead and has been inactive in IG Development since it was logged so I'm guessing it's been abandoned. In the unlikely event it actually gets addressed, I'll post the results here.
Sorry for the bad news.
Thanks and have a great day!!!
Hi,
If you do as I suggested, you can set the text of the UIElement to any text you want. If you want to base that text on another cell in the same row, you can simply look at the value in the other cell and decide what text to use? What part of this are you getting stuck on?
Thanks for your time Mike.
I did try this approach but got no closer to the solution than I did with the small code in my previous post.
The problem is not just setting the NullText. Rather, the problem is setting the NullText for the Column1 cell based upon the ValueList selection from the Column0 cell.
The goal is to get a different NullText value in the Column1 cell depending on the selection of the dropdown in Column0.
Put another way from my original post, the null text I want displayed in the Cell in Column1 is dependent on the value selected from the UltraCombo in Column0. This null text value may be different for each row.
Maybe we're saying the same thing here but in all the information present in the arguments to the methods of IUIElementCreationFilter.AfterCreateChildElements, I've not yet found a way to get the value of a different cell (than the one being dealt with in this method) for the current row.
I hope this clarifies the problem. I'll take another shot at it later and if I magically figure it out, I'll post back here.
You are almost there. There are just a couple of things I would change.
First, instead of watching for a CellUIElement, I would watch instead for a TextUIElementBase. Call GetAncestor on it to see if it's the child of a CellUIElement and then if you get one, do the same checks on the CellUIElement that you are doing now.
Second, setting the NullText property on column here isn't any better than how you were doing it before. That's not what you want. Instead, check the Value property on the cell. If it's null, then you set the TextUIElement's Text property to the null text you want displayed.