Welcome to Dream.In.Code
Getting C# Help is Easy!

Join 132,359 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 1,183 people online right now. Registration is fast and FREE... Join Now!




DataGridViewButtonCell

 
Reply to this topicStart new topic

DataGridViewButtonCell, How to effort variable button captions?

KrzychoE
post 3 Oct, 2008 - 02:35 AM
Post #1


New D.I.C Head

*
Joined: 3 Oct, 2008
Posts: 1


My Contributions


I want to have a DataGridView with one Button per row. Caption onbutton shall vary depending on other column value.
in colimn definition I wrote
UseColumnTextForButtonValue=false;

and after populating of DataTable binded to the grid I wrote such code:

CODE

                foreach (DataGridViewRow rw in TaxDataGridView.Rows)
                {
                    int cp;
                    cp=string.Compare(rw.Cells[0].Value.ToString(), "02");
                    DataGridViewButtonCell cel=(DataGridViewButtonCell)rw.Cells[6];
                    if (cp == 0)
                    {
                        cel.Value = "New payment";
                    }
                    else
                        cel.Value = " ";
                }


it's strict by MSDN instruction, but doesn't work - all buttons are blank.

Did anybody solved this problem?
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/22/08 04:27AM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month