CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2001
    Location
    UK
    Posts
    308

    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
    Venu Bharadwaj
    "Dream it. U can do it!"

  2. #2
    Join Date
    May 2003
    Location
    Germany
    Posts
    936

    Re: Displaying image in DataGrid

    Have a look here
    Useful or not? Rate my posting. Thanks.

  3. #3
    Join Date
    Feb 2005
    Location
    Israel
    Posts
    1,475

    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.

  4. #4
    Join Date
    Dec 2001
    Location
    UK
    Posts
    308

    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
    Venu Bharadwaj
    "Dream it. U can do it!"

  5. #5
    Join Date
    May 2003
    Location
    Germany
    Posts
    936

    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.
    Useful or not? Rate my posting. Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured