Mattersphere Developers Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
avatar
Heather@FootAnstey
Posts : 57
Join date : 2018-12-19

Custom ImageLists with Search Lists...? Empty Custom ImageLists with Search Lists...?

Fri 17 Apr 2020 - 14:29
Original Post: Joe Green 27/02/2013 20:45:28

"Can I use my own ImageLists for the ImageColumn on a SearchList? If I hand crank an ImageList in the code behind, how can I attach it to the SearchList? I've looked at the SearchControl object and SearchControl.dgSearchResults, but I can't find an accessor to the ImageList or ImageColumn.
Thanks, Joe"

Responses:

technical [Phil] 28/02/2013 09:04:18
"Hi Joe,
Going to try have a play with this at dinner if I get chance sounds like a good challenge.
But I imagine that a SearchControl will have an internal Datagrid to it and I'm guessing that FWBS just haven't exposed the ImageList property if that DataGrid in their control.
So could you usereflection to invoke a change to the ImageList property of that datagrid? Phil"

technical [Phil] 28/02/2013 15:06:13
"Hi Joe,
I had a play at dinner but unfortunately didn't succeed, i did however learn about more about how Matter Centre ties together. On a SearchList the Image Library dropdown seem to be tied to the below emum so adding to that isn't possible.

FWBS.OMS.UI.Windows.omsImageLists

So I presume the Matter Centre code using this enum in a switch statement and then uses the other class I found to return an image list from one of the Static methods named the same as the options in the omsImageLists enum

FWBS.OMS.UI.Windows.Images

Then I thought well what if you could bypass design time setting and set the ImageList programmatically when the Searchlist is loading so i tried using reflection.
I found the set method and the property for the Image List and tried both using the code below it was running in the BeforeCellDisplay event and a few events but it didn't seem to set.

//Set Using Method
Type t = this.SearchList.GetType(); MethodInfo m = t.GetMethod(“set_ImageList”);
object[] newList = new object[]{FWBS.OMS.UI.Windows.Images.CoolButtons16() };
m.Invoke(this.SearchList,BindingFlags.Instance| BindingFlags.Public | BindingFlags.SetProperty | BindingFlags.SetField, null, newList, System.Globalization.CultureInfo.CurrentCulture);

//Set Using Property
Type t = this.SearchList.GetType(); PropertyInfo p = t.GetProperty(“ImageList”);
p.SetValue(this.SearchList, FWBS.OMS.UI.Windows.Images.CoolButtons16(), null);

There's what I found anyway, unless you can see anything wrong with the above code then the only other thing I can think of is trying to find the Paint Event of the base control and overriding that, but that would be a massive undertaking.
Phil"



Back to top
Permissions in this forum:
You cannot reply to topics in this forum