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
Weeman Osekre
NA
56
3.9k
Data gridview operations
Nov 7 2020 9:25 AM
I working on a pos system , which at design time I have two datagridviews one which shows the searched product and one which shows the added products . The one which shows the added product has 6 columns 4 are bounded to a databondinging source and the other two are unbounded because they accept input from the user . So when the transection is done but the bill not paid and the table is reopened the gridview is not bounded to another data source . But the code I have to add rows (products) does not work any more it does add a new row . private void btnadd_Click(object sender, EventArgs e){for (int i = dataGridView1.RowCount - 1; i <= 0; i++){DataGridViewRow row = dataGridView1.Rows[i];if (Convert.ToBoolean(row.Cells["selectrow"].Value = true)){Formq pan = new Formq();pan.Show();string may = Formq.mark1;productBindingSource4.Add((Product)row.DataBoundItem);dataGridView2.Rows[dataGridView2.Rows.Count-1].Cells["quantity"].Value = may;int qu = Int32.Parse(dataGridView2.Rows[dataGridView2.Rows.Count - 1].Cells["quantity"].Value.ToString());string pp = dataGridView2.Rows[dataGridView2.Rows.Count - 1].Cells[3].Value.ToString();Double rpp = Double.Parse(pp);Decimal rrpp = (decimal)rpp;Decimal tp = rrpp * qu;dataGridView2.Rows[dataGridView2.Rows.Count - 1].Cells["tprice"].Value = tp+".00";Double sum = 0;for (int f = 0; f < dataGridView2.Rows.Count; f++){sum += double.Parse(dataGridView2.Rows[f].Cells[6].Value.ToString());}string msun =( sum.ToString());libt2.Text = msun ;
Reply
Answers (
2
)
GetInvalidFileNameChars or part of the loop erroring
Return Partial views based on condition best approach.