public void FillCombos()
{
try
{
//Fill General Combo
dtGeneral = new DataTable();
dtGeneral.Columns.Add("F_GN_ID");
dtGeneral.Columns.Add("F_GN_Name");
dtGeneral.AcceptChanges();
DataRow dr = dtGeneral.NewRow();
dr[0] = "0";
dr[1] = "General";
dtGeneral.Rows.Add(dr);
dtGeneral.AcceptChanges();
cmbGeneral.ItemsSource = dtGeneral.DefaultView;
cmbGeneral.DisplayMemberPath = dtGeneral.Columns["F_GN_Name"].ToString();
cmbGeneral.SelectedValuePath = dtGeneral.Columns["F_GN_ID"].ToString();
cmbGeneral.SelectedValue = "0";
//Fill General Combo
}
catch (Exception ex)
{
ErrorLog.WriteErrorLog(ErrorLog.GetLogFilePath(), ex);
}
}
{
try
{
//Fill General Combo
dtGeneral = new DataTable();
dtGeneral.Columns.Add("F_GN_ID");
dtGeneral.Columns.Add("F_GN_Name");
dtGeneral.AcceptChanges();
DataRow dr = dtGeneral.NewRow();
dr[0] = "0";
dr[1] = "General";
dtGeneral.Rows.Add(dr);
dtGeneral.AcceptChanges();
cmbGeneral.ItemsSource = dtGeneral.DefaultView;
cmbGeneral.DisplayMemberPath = dtGeneral.Columns["F_GN_Name"].ToString();
cmbGeneral.SelectedValuePath = dtGeneral.Columns["F_GN_ID"].ToString();
cmbGeneral.SelectedValue = "0";
//Fill General Combo
}
catch (Exception ex)
{
ErrorLog.WriteErrorLog(ErrorLog.GetLogFilePath(), ex);
}
}
No comments:
Post a Comment