Results 1 to 5 of 5

Thread: [2008] Inagecolumn question for Datagridview

  1. #1

    Thread Starter
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 2007
    Location
    Death Valley
    Posts
    2,556

    [2008] Inagecolumn question for Datagridview

    Hi guys,

    I want to add an imagecolumn for my bound datagridview. for each row, I will have a calltype of outgoing or incoming, so I want to display different images for outgoing calls and incoming calls. How can I do that even though my dgv is bound to a datatable.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2008] Inagecolumn question for Datagridview

    Add an image column at design time.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 2007
    Location
    Death Valley
    Posts
    2,556

    Re: [2008] Inagecolumn question for Datagridview

    Thanks jm, but how can I determine which image to show in a row based on the column that either has Incoming or Outgoing.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2008] Inagecolumn question for Datagridview

    Handle the appropriate event(s) of the grid and use an If statement to test the value of one cell and set the value of the other accordingly.

    Make sure you create two, and only two, Image objects at the start and then just use those same Images each time. Don't make the mistake of creating new Image objects every time.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 2007
    Location
    Death Valley
    Posts
    2,556

    Re: [2008] Inagecolumn question for Datagridview

    thanks again jm. I will give it a try

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