private void SetData(DataTable dt) { TxtDescription.Tag = dt.Rows[0]["CounterId"].ToString(); TxtDescription.Text = dt.Rows[0]["CounterDesc"].ToString(); TxtShortName.Text = dt.Rows[0]["CounterShortName"].ToString(); TxtGodown.Text = dt.Rows[0]["GodownDesc"].ToString(); CmbPrinterName.SelectedIndex = CmbPrinterName.FindString(dt.Rows[0]["PrinterName"].ToString()); CbActive.Checked = Convert.ToBoolean(dt.Rows[0]["Status"].ToString()); TxtDescription.SelectAll(); }
private void ClearFld() { _CounterId = 0; TxtDescription.Tag = "0"; foreach (Control control in PanelContainer.Controls) { if (control is TextBox) { control.Text = ""; } } CbActive.Checked = true; string strDefaultPrinter = _objPrintDocument.PrinterSettings.PrinterName; CmbPrinterName.SelectedIndex = CmbPrinterName.FindString(strDefaultPrinter); TxtDescription.Focus(); }