Hi,
If have an ultragrid which show the status of different orders. I use images (colored dots) to show the status on the order. (red is a new order, Yellow the order is on hand, blue the order is in backorder and green the order is completed. these colors are equal to a number (red=1, yellow=2, blue=3 and green is 4)
I would like to show the images in the filter instead of the numbers.
Anyone an idea how to handle this ?
thnx in advance
regards Ton
Hello Ton,
What you can do is create a ValueList for your Status column. In ValueList add all the statuses as value list items. Assign to each item appropriate picture through its Appearance. Then set the value lists’s DisplayStyle to Picture. This will force the value list to show pictures instead of text. Finally assign the value list to ValueList property of your Status column. This should force the grid to show images in the filter.
Attached is a sample project where I have implemented this approach.
Please let me know if you have any additional questions.
Hi Milko
I tried already such thing :
' Create a ValueList with an image for each item. Dim StatusList As ValueList = e.Layout.ValueLists.Add("Status") Dim vli As ValueListItem = StatusList.ValueListItems.Add("1") vli.Appearance.Image = My.Resources.Rond_rood vli = StatusList.ValueListItems.Add("2") vli.Appearance.Image = My.Resources.Rond_geel vli = StatusList.ValueListItems.Add("3") vli.Appearance.Image = My.Resources.Rond_blauw vli = StatusList.ValueListItems.Add("4") vli.Appearance.Image = My.Resources.Rond_groen
e.Layout.Bands(0).Columns("SME").ValueList = StatusList e.Layout.Bands(0).Columns("SPU").ValueList = StatusList e.Layout.Bands(0).Columns("MON").ValueList = StatusList e.Layout.Bands(0).Columns("MWE").ValueList = StatusList e.Layout.Bands(0).Columns("SER").ValueList = StatusList e.Layout.Bands(0).Columns("TRA").ValueList = StatusList e.Layout.Bands(0).Columns("EXP").ValueList = StatusList
e.Layout.Bands(1).Columns("SME").ValueList = StatusList e.Layout.Bands(1).Columns("SPU").ValueList = StatusList
when i used the normal filtering it worked. but after changing to the ultragriduiprovider i get only the numbers
what do i do wrong
Hello,
The UltraGridFilterUIProvider doesn't use the ValueList to display the items. Internally, it uses an UltraTree to display the list of checkbox items. In order to display images on the tree, you'll need to use a CreationFilter to gain access to the tree, then assign the Image for each node in the Nodes collection. I created a new sample (in VB.NET this time) that demonstrates the creation filter I mentioned. Let us know if you have any issues.
Thanks,
Chris
Thanks a lot Chris,
That was the solution :-)
Best regards
Ton