Example #1
0
 /// <summary>
 /// 새로운 라인을 생성한다.
 /// </summary>
 /// <returns>추가한 Row번호</returns>
 public int AddNewRow()
 {
     if (MainView.DataSource == null)
     {
         var dt = new DataTable();
         foreach (GridColumn col in MainView.Columns)
         {
             dt.Columns.Add(col.FieldName, col.ColumnType);
         }
         var dr = dt.NewRow();
         dt.Rows.Add(dr);
         DataSource = dt;
     }
     else
     {
         MainView.PostEditor();
         MainView.UpdateCurrentRow();
         var dt = (DataTable)DataSource;
         var dr = dt.NewRow();
         dt.Rows.Add(dr);
         DataSource = dt;
     }
     MainGrid.RefreshDataSource();
     return(MainView.RowCount - 1);
 }
Example #2
0
 void LoadData(Response_Posts data)
 {
     try
     {
         if (data != null)
         {
             MainGrid.DataSource = data.data;
             MainGrid.RefreshDataSource();
         }
     }catch (Exception ex)
     {
     }
 }