TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
John Clark
NA
5
4.7k
DataGridView in invoice maker
Dec 26 2014 11:02 AM
Hi .. I am new at c# . I am making an invoice generator . In it i am using dataGridView. Its a very new to me. GridView has 4 columns. Item, Quantity, PriceperItem and total. Values in 'item' clumn come from database. and user enters values of 'quantity' and 'priceperitem'. the total value should be automatically generted by calculating quantity*priceperitem when user click on 'yotal' column's cell. I have searched on google alottt but still wondering. I have done something like this but of no value. Kindly help me. Thanks in advance.
public void newFunc()
{
string val;
string val1;
int col = this.dataGridView1.CurrentCell.ColumnIndex;
if (col == 3)
{
val = this.dataGridView1.Columns[1].ToString();
val1 = this.dataGridView1.Columns[2].ToString();
int v = int.Parse(val);
int v1 = int.Parse(val1);
int v2 = v * v1;
this.dataGridView1.CurrentCell.Value = v2;
}
}
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
newFunc();
}
Reply
Answers (
2
)
DataGridView in invoice maker
c# regex