public void MountedListLoad() { try { string pageIndexAndCount = winFormPager1.PageIndex + "." + winFormPager1.PageSize; ResultModelOfArrayOfModel_ColdstoragePDAd4FqxSXX coldpdalist = cs.GetColdstoragePDAList(0, true, 2, true, pageIndexAndCount); ResultModelOfArrayOfModel_ColdstoragePDAd4FqxSXX count = cs.GetColdstoragePDAList(0, true, 2, true, null); winFormPager1.DrawControl(count.Data.Count <Model_ColdstoragePDA>()); if (count.Data.Count <Model_ColdstoragePDA>() <= 0) { contextMenuStrip1.Enabled = false; } else { contextMenuStrip1.Enabled = true; } if (coldpdalist.Code != 0) { MessageBox.Show(coldpdalist.Message); } else { dataGridView1.AutoGenerateColumns = false; dataGridView1.Rows.Clear(); foreach (Model_ColdstoragePDA item in coldpdalist.Data) { int rowIndex = dataGridView1.Rows.Add(); dataGridView1.Rows[rowIndex].Cells[0].Value = item.StorageIdk__BackingField; dataGridView1.Rows[rowIndex].Cells[1].Value = item.StorageNamek__BackingField; dataGridView1.Rows[rowIndex].Cells[2].Value = item.Driverk__BackingField; dataGridView1.Rows[rowIndex].Cells[3].Value = item.DriverTelk__BackingField; dataGridView1.Rows[rowIndex].Cells[4].Value = item.Remarkk__BackingField; dataGridView1.Rows[rowIndex].Cells[5].Value = item.StorageCreateAtk__BackingField.ToString("yyyy-MM-dd HH:mm:ss"); dataGridView1.Rows[rowIndex].Cells[6].Value = item.Namek__BackingField; dataGridView1.Rows[rowIndex].Tag = item; } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }