Displaying image in DataGrid
In Windows application, I hv associated the DataGrid to the DataSet, which has a Boolean column. Based on the Boolean value I need to display a image in datagrid. i.e. if the column value is true, first image should be displayed or if it is false second image should be displayed.
Any idea how to achieve this?
Thanks in adv
Venu
Re: Displaying image in DataGrid
Re: Displaying image in DataGrid
In .NET 2003 there is no built in column style for images, you will need to implement one yourself by deriving from DataGridColumnStyle.
Re: Displaying image in DataGrid
This code helps in displaying the image exist in DB. In my scenario, i hv Boolean value in DB and based on this value i hv to display the image in datagrid.
any idea on this ?
thanks
Re: Displaying image in DataGrid
Where is the problem? You have only to reimplement the ExtractImageFromOleContainer() method of the DataGridImageClass in that example and your done. Or you have to replace this method-call in the paint methods by writing your own method. It is really easy.
I think you will not found an easier way without implementing it from the scratch.