private void findkryptonButton1_Click(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; updateEntity(); IList result = r_part.FindAllMarkDownSellingPrice(m_marksellingprice); partDataGridView1.Rows.Clear(); m_result = result; foreach (Part p in result) { p.UNIT = m_unitDic[p.UNIT.ID]; p.PART_GROUP = m_partGroupDic[p.PART_GROUP.ID]; p.PART_CATEGORY = m_partCategoryDic[p.PART_CATEGORY.ID]; p.CURRENCY = m_ccyDic[p.CURRENCY.ID]; int r = partDataGridView1.Rows.Add(); partDataGridView1[codeColumn.Index, r].Value = p.CODE; partDataGridView1[nameColumn.Index, r].Value = p.NAME; partDataGridView1[codeColumn.Index, r].Value = p.CODE; partDataGridView1[unitColumn.Index, r].Value = p.UNIT.CODE; partDataGridView1[groupColumn.Index, r].Value = p.PART_GROUP.CODE; partDataGridView1[categoryColumn.Index, r].Value = p.PART_CATEGORY.CODE; partDataGridView1[costpriceColumn.Index, r].Value = p.COST_PRICE; partDataGridView1[sellpriceColumn.Index, r].Value = p.SELL_PRICE; partDataGridView1[newsellpriceColumn.Index, r].Value = p.NEW_SELL_PRICE; partDataGridView1[ccyColumn.Index, r].Value = p.CURRENCY.CODE; partDataGridView1.Rows[r].Tag = p; } foundkryptonLabel12.Text = "Found " + partDataGridView1.Rows.Count + " record(s)"; UserSetting.AddNumberToGrid(partDataGridView1); this.Cursor = Cursors.Default; } catch (Exception x) { KryptonMessageBox.Show(x.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { this.Cursor = Cursors.Default; } }