ButtonAddRow.cs 892 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System;
  2. using System.Data;
  3. using DevExpress.XtraEditors;
  4. using UAS_PLCDataReader.Entity;
  5. namespace UAS_PLCDataReader.CustomerControl.Button
  6. {
  7. public partial class ButtonAddRow : SimpleButton
  8. {
  9. private AutoDataGridControl.AutoDataGridControl grid;
  10. public AutoDataGridControl.AutoDataGridControl Grid
  11. {
  12. get
  13. {
  14. return grid;
  15. }
  16. set
  17. {
  18. grid = value;
  19. }
  20. }
  21. public ButtonAddRow()
  22. {
  23. InitializeComponent();
  24. }
  25. private void ButtonSaveGrid_Click(object sender, EventArgs e)
  26. {
  27. }
  28. private void ButtonAddRow_Click(object sender, EventArgs e)
  29. {
  30. DataTable dt = (DataTable)grid.DataSource;
  31. if (dt != null)
  32. dt.Rows.Add();
  33. }
  34. }
  35. }