Beispiel #1
0
        private void ListLeasing()
        {
            try
            {
                DataTable dt = FillComboBox.DBGetLeasing(Guid.Empty);

                if (dt.Rows.Count > 0)
                {
                    dt.DefaultView.Sort      = "Nama ASC";
                    cboLeasing.DisplayMember = "Nama";
                    cboLeasing.ValueMember   = "RowID";
                    DataRow dr = dt.NewRow();
                    dr["RowID"] = Guid.Empty;
                    dr["Nama"]  = "";
                    dt.Rows.Add(dr);
                    cboLeasing.DataSource = dt.DefaultView;
                }
                else
                {
                    dt.Clear();
                    cboLeasing.DataSource = dt;
                }
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
        }