Showing an icon in a gridview (WPF)
-
I need to display icons next to items in a listview (using gridview) with WPF. Does anyone have a sample of this ?
Johan Lombaard Only two things are infinite, the universe and human stupidity, and I'm not sure about the former - Albert Einstein
-
I need to display icons next to items in a listview (using gridview) with WPF. Does anyone have a sample of this ?
Johan Lombaard Only two things are infinite, the universe and human stupidity, and I'm not sure about the former - Albert Einstein
Normally I would suggest using an asp:Image control, but I am not sure if the ImageUrl support Icon files. Why wouldn't you use gif or jpg files instead? Anyway, it might work with icon files. First create a new column that is a template column in your gridview. Once you have a template column you have an ItemTemplate and an EditTemplate. Create an asp:Image control in the itemtemplate and bind it to the correct variable that has the imageurl in it. If you allow editing to your grid view you will need to add it there as well if you want the image to be seen when editing. Hope that helps. Ben