private void addtxtbox(int num, TextBox txtbox) { txtbox.Visible = true; Rectangle rect2 = DgvList.GetCellDisplayRectangle(num, SelectRowIndex, true); txtbox.Size = rect2.Size; txtbox.Top = rect2.Top; txtbox.Left = rect2.Left; string str = DgvList[num, SelectRowIndex].Value.ToString(); if (str.Contains("(")) { txtbox.Text = str.Split('(')[0].ToString(); } else { txtbox.Text = IsNumeric(str).ToString(); } txtbox1_TextChanged(null, null); if (isSencond) { txtbox2_TextChanged(null, null); } isSencond = false; }
private void addcontrols(int col, int row, Control con) { con.Visible = true; Rectangle rect = DgvList.GetCellDisplayRectangle(col, row, true); con.Size = rect.Size; con.Top = rect.Top; con.Left = rect.Left; }
private void addTypebox(int num, ComboBox cb) { Rectangle rect = DgvList.GetCellDisplayRectangle(num, SelectRowIndex, true); cb.Visible = true; cb.Size = rect.Size; cb.Top = rect.Top; cb.Left = rect.Left; cb.Text = DgvList[num, SelectRowIndex].Value.ToString(); }
private void addtimetxt(int num) { timetxt.Visible = true; Rectangle rect2 = DgvList.GetCellDisplayRectangle(num, SelectRowIndex, true); timetxt.Size = rect2.Size; timetxt.Top = rect2.Top; timetxt.Left = rect2.Left; string str = DgvList[num, SelectRowIndex].Value.ToString(); if (str.Contains(":")) { timetxt.Text = HDLPF.GetTimeFromString(str, ':'); } else { timetxt.Text = "0:0"; } timetxt_TextChanged(null, null); }
private void button1_Click(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; Application.DoEvents(); string cnd = " Where 1=1 "; if (checkBox1.Checked) { cnd = cnd + " And issue_month='01-" + DtpMnth.Value.ToString("MMM-yyyy") + "'"; } if (checkBox2.Checked) { cnd = cnd + " And Issue_date='" + DtpIssueDate.Value.ToString("dd-MMM-yyyy") + "'"; } if (TxtKeyword.Text.Trim().Length > 0) { cnd = cnd + " And to_char(issue_id)||voucher_no||to_char(sub_id)||state_name||district_Name||sub_name||address||pin_code||email_id||contact_no||to_char(current_issue) like '%" + TxtKeyword.Text.Trim().ToUpper() + "%'"; } DataSet ds = db.GetTableData("select issue_id \"Book ID\", voucher_no \"Voucher No\", sub_id \"Subscription ID\", Sub_name \"Subcriber Name\", Address, State_name \"State\", District_name \"District\", Pin_Code \"PIN Code\",email_id \"E - Mail\", contact_no \"Contact No.\", to_char(issue_month,'MON-yy') \"Subscription Month\", to_char(issue_date,'dd-MON-yy') \"Dispatched Date\", current_issue \"Issued No\",SUB_TYPE_NAME \"Sub. Type\", EXECUTIVE_NAME \"Executive Name\", action_type from vew_labels " + cnd + " order by issue_id"); DgvList.DataSource = ds.Tables[0]; DgvList.Columns["action_type"].Visible = false; DgvList.Refresh(); double qty = 0; ds = db.GetTableData("select nvl(sum(quantity),0) qty, decode(action_type,'U','I',action_type) Action_type from vew_labels " + cnd + " group by decode(action_type,'U','I',action_type)"); foreach (DataRow dr in ds.Tables[0].Rows) { qty = Convert.ToDouble(dr[0].ToString()); } label2.Text = "No. of Subscribers found : " + DgvList.Rows.Count.ToString() + " (No. of Books : " + qty.ToString() + ")"; Cursor.Current = Cursors.Default; Application.DoEvents(); }
private void DgvList_CurrentCellDirtyStateChanged(object sender, EventArgs e) { DgvList.CommitEdit(DataGridViewDataErrorContexts.Commit); }