473,396 Members | 1,789 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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
Jan 1 '09 #1
4 4866
RedSon
5,000 Expert 4TB
It'd probably help more if you posted your code.
Jan 1 '09 #2
vekipeki
229 Expert 100+
When you say you have some "merged cells", I presume it means you are handling the CellPainting event and then drawing them yourself to look merged? Note that since these cells are internally not merged, DataGridView will only raise the event if it thinks it should draw a specific cell, not a range of cells.
Jan 2 '09 #3
Plater
7,872 Expert 4TB
@kulabhishek
and you are sure there are 17 rows in your object?
Jan 2 '09 #4
Ya there are 17 rows in object.

The problem is not yet solved, but now i removed the DataGridView and painting my control in paint event only.

Thanks for all your help

Regards
Abhishek
Jan 12 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Lennart Nielsen | last post by:
How do you change the font size dynamically in a single selected cell? Lennart
1
by: Diogo Alves - Software Developer | last post by:
Hi, I am using VS 2005 and I want to know if it is possible to override the onPaint() method of the header of the datagrid columns and if it is possible how can I do it? Thanks a lot for...
7
by: steve | last post by:
Hi All I urgently need help on setting datagridview cell borders at runtime I found some code on the web from Programming Smart Client Data Applications with .NET 2.0 by Brian Noyes See...
2
by: Rich | last post by:
Hello, Some database applicatins have a tooltip feature where when you are dragging the scrollbar of the table view a tooltip appears next to the mouse cursor displaying the approximate record...
8
by: Brian Pelton | last post by:
This is on .Net 2.0 in a WinForms application. I have a DataGridView that is bound to a BindingSource. The DataGridView has 3 columns. The first two are "normal" text columns and the last is a...
3
by: Richard Lewis Haggard | last post by:
I have a DataGridView which has a cell that is going to contain what might be a large amount of text data. The UI designed has decreed that each row will have a button that toggles the row's...
2
by: Steve | last post by:
Hi All I am using VB.net 2005 windows forms I use the Datagridview.cellformatting event to change the colours of individual cells as required and all works fine How can I do the same for...
6
by: Simon Harvey | last post by:
Hi all, I'm really hoping someone can help me with this as it's causing me some serious problems. I have a Windows Forms application using the gridview control. When the user selects a row,...
5
by: Ashutosh | last post by:
Hi, I have a DataGridView which has as typed data-set associated with it. For the table which I am displaying in it, I want to display certain cells (corresponding to a column in the database) to...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.