In VB.NET 2005, how can I have a DataGridViewButtonColumn display different text for every row based on a sql recordset?

Posted on 2008-02-05
Medium Priority
Last Modified: 2013-11-26

I am using VB.NET 2005.
I have a form with a datagridview that is being populated by a datatable filled with results from a sql resultset.
One of my columns is a DataGridViewButtonColumn.
I want the text for each one of the buttons to display the value that is returned from sql.
I know how to have the button cell in every row to display the same text, but i don't want that. I want it to display the different results from sql.

Anyone know how to do this?

Thank you

Question by:fesit
LVL 41

Accepted Solution

graye earned 2000 total points
ID: 20824363
That's suppose to be the default behavior for the DataGridViewButtonColumn.   In fact, you'd have to manually set the UseColumnTextForButtonValue property to True in order override the defaults.

Show us a bit of code on how you've got the data bound to the control


Author Comment

ID: 20825505
Don't I feel dumb.
I changed the value of UseColumnTextForButtonValue  and never changed it back to see what happened with the default value.  I was just over thinking it.....

Well, thank you - easy 500 points.

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
How to fix display issue, screen flickering issue when I plug in power cord to the machine. Before I start explaining the solution lets check out once the issue how it looks like after I connect the power cord. most of you also have faced this…
Hi, this video explains a free download that you can incorporate into your Access databases, or use stand-alone for contact management. Contacts -- Names, Addresses, Phone Numbers, eMail Addresses, Websites, Lists, Projects, Notes, Attachments…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question