Windows Develop Bookmark and Share   
 index > Windows Forms Sample Applications > DataGridView not raising CellPainting event
 

DataGridView not raising CellPainting event

Hello all,

I am using DataGridView in my user control and its CellPainting event in C#. I have some merged cells in my control.
When I drag & drop my control in other application, the LAST ROW of the DataGridView is not getting painted. Rest of the rows and columns in those rows are getting painted properly.
Actually problem here is DataGridView is not raising CellPainting event for that last row. The rest of the things like DataSet & DataTable are there getting updated correctly, but last row is not getting painted.
Even when i debugged the app, the break point did not hit for
e.RowIndex == 16.

Can anyone please help me with this....

Thanks in advance
Abhishek
  • Changed TypeSteven.Yu Wednesday, January 07, 2009 1:52 AM
  • Changed TypeSteven.Yu Wednesday, January 07, 2009 1:52 AM
  •  
Kulabhishek  Thursday, January 01, 2009 7:54 AM
Hi Kulabhishek,

I have made a test by my side, the CellPaintin event of theDataGridView in my user controloccurs when my app is running.
If it didn't hit for e.RowIndex==16, check whether there are 17 rows in your DataGridView.

But I don't know exactly your situation.
If convenience, wouldyou like toshare more details as the data stucture of your DataGridView or the code in your CellPaiting event?

If there's any problem, please feel free to let me know.

Best regards,
Steven Yu
Steven.Yu  Friday, January 02, 2009 5:27 AM

Hi Kulabhishek,

We are changing the issue type to “Comment�because we are not sure whether your problem has been solved. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to “Question�by clicking options, choosing Change Type and changing the type. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.

Thank you!

Best Regards

Stevem Yu

Steven.Yu  Wednesday, January 07, 2009 1:52 AM
Hi Steven,

The issue is still not resolved, but unfortunately i don't have enough time to wait for the solution. Now i have removed the DataGridView and using "User Control" and its paint event.

Thanks for all your help.

Regards
Abhishek


Kulabhishek  Monday, January 12, 2009 8:46 AM
Hi Steven,

Can you suggest me something for this problem

http://social.msdn.microsoft.com/Forums/en-US/winformsapplications/thread/4a9e6ade-7c35-4f21-bf68-91a9b78c5b89

Regards
Abhishek
Kulabhishek  Monday, January 12, 2009 9:06 AM

You can use google to search for other answers

Custom Search

More Threads

• FTP In window form
• Using VS Studio .NET vs. VS Studio .NET 2003 w/ Pocket PC TaskVision Client
• Suggestions
• Data Disappeared
• Extended exercise of Musical Console Sample from MSDN Download site
• Problems Creating an Installer Package
• Modeling ASP.net security
• A product like TaskVision
• See What URL present on Internet Explorer
• WebService tickets