Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how can I sum values in grid cell when I checked the checkbox on the instant
Posted
Comments
Sergey Alexandrovich Kryukov 10-Sep-13 18:33pm    
What do you mean by "Gridview"? Which one? Exact fully-qualified type name, please. What's the problem. http://www.whathaveyoutried.com so far?
—SA
Member 10256795 10-Sep-13 18:35pm    
I mean winforms Gridview control
Sergey Alexandrovich Kryukov 10-Sep-13 18:40pm    
Then use System.Windows.Forms.DataGridView. Don't waste time on old lousy staff left in FCL only for backup compatibility with already written code. And what's the problem? If you can use a grid view in any way at all, you should be able to get and set cell values...
—SA
Member 10256795 10-Sep-13 18:38pm    
I want to use gridview for sum some values in cells. I want to try it with using checkbox coloumn in gridview, but I cant sum values when click on the instant, which event can I use for this problem?
Member 10256795 10-Sep-13 19:36pm    
I cannot solve, I'm beginner in c#. Suppose that a form only textBox and DataGridView with check box coloumn. No button. When I click first row checkbox it will write the value to textbox when I uncheck it will clear textbox.

Thanks for help...

1 solution

Please see my comments to the question. All you need is this:
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcell.value.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcell.valuetype.aspx[^].

What is "click on the instant"? Anyway, no matter what you want to click on, I hope you know how to handle event. But do you know how to read MSDN? It's well documented and well to easy to find out such things.

—SA
 
Share this answer
 
Comments
Member 10256795 10-Sep-13 19:04pm    
I cannot solve, I'm beginner in c#. Suppose that a form only textBox and DataGridView with check box coloumn. No button. When I click first row checkbox it will write the value to textbox when I uncheck it will clear textbox.

Thanks for help...
Sergey Alexandrovich Kryukov 10-Sep-13 20:04pm    
I would not advise "no button", but what else could be a problem? If it is difficult, you should lean on somewhat simpler projects. Can you create classes, create and handle events? Properties, generics? Virtual, overriding, interfaces, polymorphism? Before getting to UI, you should better learn it all on simple projects, probably console-only... Otherwise, what's would be the answer except writing the full code for you?.. :-)
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900