C# WinForm DataGridView question

J

Jason Huang

Hi,

In my C# WinForm application, saying a DataGridView has 3 columns.
What I would like to do is to let the Column3' value equal to Column1 value
X Column2 value.
How do I do that?
Thanks for help.


Jason
 
A

Arto Viitanen

Jason said:
Hi,

In my C# WinForm application, saying a DataGridView has 3 columns.
What I would like to do is to let the Column3' value equal to Column1 value
X Column2 value.
How do I do that?
Thanks for help.


Jason

I have not used it, but it seems that Virtual Mode with CellValueNeeded
event does the trick. The event occurs when the cell's value is needed
(to be shown), so you can calculate column3 from column1 times column2.
For more, check http://msdn.microsoft.com/en-us/library/ms171622.aspx .
 
J

Joe Cool

Hi,

In my C# WinForm application, saying a DataGridView has 3 columns.
What I would like to do is to let the Column3' value equal to Column1 value
X Column2 value.
How do I do that?
Thanks for help.

I think what you need to look into is the CellValueChanged event.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top