Image display problem in DatagridViewImageColumn

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • viji chandran
    New Member
    • Mar 2010
    • 5

    Image display problem in DatagridViewImageColumn

    Hi...

    I am developing an application in .Net 2005 which

    has a DataGridView, like Microsoft outlook. I want

    to mark read and unread for each mail. I am trying

    to put one image for read(open mail image) and

    another image for unread(close image).This gridview

    is having five columns, two image columns and other

    text column. i have to put the image in

    cell_painting event. As the cell paint event is

    called every time(like mouse move event, mouse down

    event etc), the DataGridView is getting hanged(i

    can see the window below the DataGridView. the page

    or form, which is just below the frame is viewed).

    i tried to solve this by adding a

    DataGridView.Re fresh(). in DataGridView's scroll

    event, and mouse down event.
    But Now am getting another problem, any

    message box or any other form trying to open over

    the outlook form is not seen. that is, the message

    box is not shown. when i press ALT, the message

    box is shown. it can be seen.
    I cant figure out the problem. please help

    me. All replies and help will be highly

    appreciated.

    The code is like this

    In cell paint event()
    {
    if(DataGridView .Column

    [e.ColumnIndex].HeaderText=="S tatus")//Status is my

    image column in which i will put the read or unread

    image
    {
    e.value=MyAppli cation.global:: prperties.resou rce.Re

    ad;
    e.DrawImage
    }
    }

    I tried with Invalidate and refresh. But didnt work for me. Almost 30 mails will come in one second. So the gridview will bvecome hang.


    Please help..
  • viji chandran
    New Member
    • Mar 2010
    • 5

    #2
    Image display probelm In DataGridView

    Hi All...

    I am developing an application .net 2.0 (windows Forms - MDI Application.) I need to display mails in a DataGridView with Image (Read and Unread Image). I have used a DataGridViewIma ge column and i trying to put the image in that column in Cell_Painting event. But after displaying the image the grid is behaving weird. I can see the frame below the grid,(tranparen t). When i move the Form, it will become perfect. Also am not able to view ant message box which comes over the window.

    Almost 20 mails will come in one second, the grid is getting hanged while the mails are coming. Please anyonehelp me..


    In cellpainting event of the grid........... .

    If (.ColumnIndex = 1 )
    {
    e.value=Image.F romFile("f:\Rea d1.bmp")
    }

    }

    Comment

    • viji chandran
      New Member
      • Mar 2010
      • 5

      #3
      pls reply me as soon as possible...

      Comment

      • tlhintoq
        Recognized Expert Specialist
        • Mar 2008
        • 3532

        #4
        Please don't double-post your questions. It divides attempts to help you in an organized and cohesive manner. Your threads have been merged

        Comment

        • viji chandran
          New Member
          • Mar 2010
          • 5

          #5
          Sorry. I think i have posted the secondtime unknowingly.. please excuse me...
          Please reply me, as am stuck with this issue.

          Comment

          Working...