Hello,
I am using an UltraGrid with virtual mode. I need to draw images and show the row numbers on row selectors. The image are drawn based on the height of individual rows and states of the row data. Besides, user can click on the image to trigger an action. I saw some online sample code about displaying row numbers, but I could not find way online about drawing images. We also need to show the triangle image for active row.
I have successfully derived classes from RowSelectorHeaderUIElement and HeaderUIElement for our RowSelectorHeader and column Headers. Class RowSelectorUIElement cannot be derived because it does have any public constructor. Ideally, I would like to have my own row selector class.
Any suggestions will be greatly appreciated.
Thanks,Shaolin
Hi Shaolin,
It might be possible to do something like this using a simpler method. Can you send me a mock-up of how you want the final UI to appear? I'll see what I can do to help you to achieve your design.
Hi Mike,
Thanks for your response!
I derived a class called RowSelectorControlUIElement from class UIElement. I create instance of this class add it as a child of each RowSelectorUIElement object in method AfterCreateChildElements of my creation filter.
The row number is drawn in method DrawForeground. The active row indicator is drawn in method DrawImage.
There is another image that can be of a few different forms based on the row state. The data rows in the grid are either parent or a child and this image is used as connectors between a parent with its child rows. The image shown in the attached screen shot is for a parent row with a Collapsed state. This image is also drawn in DrawImage method. I am having an issue with this image. It does not always showing up for all rows when I do up and down navigation. I put Trace statement inside DrawImage method and the code for drawing this image is definitely called for all visible rows.
I am not sure what I did wrong. If you can come up a better way, it would be great.
Any help is greatly appreciated,
Regards,Shaolin
I've created a sample that accomplishes the following:
1) More space for RowSelectorArea2) Row numbers3) Expansion indicator shown in RowSelectorArea
I added more space for the RowSelectorArea by setting the RowSelectorWidth property on the Override.I enabled row numbers by setting the RowSelectorNumberStyle propery on the Override to RowSelectorNumberStyle.ListIndex.I used a creation filter to show the expansion indicators. Please see the sample for the implementation details.
The sample is attached. Please let me know if it works for you.
Thanks so much for your sample app!
Unfortunately, I cannot use your suggested method. I cannot use an ExpansionIndicatorUIElement here. I need to draw Expanded and Collapsed images for a parent row and also connection lines between the parent and its children. These connection lines can vary based on parent and child relationship settings.
Can you elaborate on your requirements? What type of connection lines do you need? What do you need the expanded/collapsed images to convey that the default indicators do not? Would it be possible to use the default expansion indicators and connector lines? Please let me know.
I solved my problem. I used an UIElement to draw my images inside my RowSelectorControlUIElement.
Thanks again,Shaolin