Start Free Trial
Come for the solution, stay for everything else.
Start Free Trial
Can I disable a button in a DataGridViewButtonCell?
Can I disable a button embedded in a DataGridView, created by adding a DataGridViewButtonColumn?
8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Log in or sign up to see answer
Become an EE member today
7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Oh my gosh. In other words, no.
But you've heroically added the functionality that was missing. Standing ovation.
I'll need to think about whether I want to add that much code to my app for such a simple thing, but that is good work.
This is straight from the MSDN site. The problem is that it doesn't work when there are more rows in the grid than can be displayed on the form. The example code only deals with 8 rows. When you try to scroll down, it generates an error.
xception was unhandled by user code
Message="Specified argument was out of the range of valid values.\r\nParameter name: rowIndex"
e inheritedCellStyle, Int32 rowIndex, Boolean includeColors)
raphics graphics, Rectangle clipBounds, Rectangle cellBounds, Int32 rowIndex, DataGridViewElementStates elementState, Object value, Object formattedValue, String errorText, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorder
Style advancedBorderStyle, DataGridViewPaintParts paintParts) in C:\Documents and Settings\sddamge\My Documents\Visual Studio 2008\Projects\Class Libraries\GridSolution\Gug
graphics, Rectangle clipBounds, Rectangle cellBounds, Int32 rowIndex, DataGridViewElementStates cellState, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorder
Style advancedBorderStyle, DataGridViewPaintParts paintParts)
graphics, Rectangle clipBounds, Rectangle rowBounds, Int32 rowIndex, DataGridViewElementStates rowState, Boolean isFirstDisplayedRow, Boolean isLastVisibleRow, DataGridViewPaintParts paintParts)
phics graphics, Rectangle clipBounds, Rectangle rowBounds, Int32 rowIndex, DataGridViewElementStates rowState, Boolean isFirstDisplayedRow, Boolean isLastVisibleRow)
aphics g, Rectangle boundingRect, Rectangle clipRect, Boolean singleHorizontalBorderAdde
aphics g, Rectangle gridBounds, Rectangle clipRect, Boolean singleVerticalBorderAdded,
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
Plans and Pricing
Certified Expert Program
© 1996-2022 Experts Exchange, LLC. All rights reserved. Covered by US Patent