コード例 #1
0
 public static IEnumerable ShowInGrid(this IEnumerable enumerable, IDataEditorPersister dataEditorPersister, ushort pageSize)
 {
     if (enumerable != null)
     {
         FrmDataEditor.CreateDataEditorForm(enumerable, new GridDataEditor {
             Dock = DockStyle.Fill
         }, dataEditorPersister, pageSize, false).ShowDialog();
     }
     return(enumerable);
 }
コード例 #2
0
 /// <summary>
 /// Edits the enumerable in a DataGridView.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="enumerable">The enumerable.</param>
 /// <param name="dataEditorPersister">The grid data editor persister.</param>
 /// <param name="pageSize">Size of the page.</param>
 /// <returns></returns>
 public static IEnumerable <T> ShowInGrid <T>(this IEnumerable <T> enumerable, IDataEditorPersister dataEditorPersister, ushort pageSize)
 {
     if (enumerable != null)
     {
         var        stringEnumerable = enumerable as IEnumerable <string>;
         const bool readOnly         = false;
         if (stringEnumerable != null)
         {
             stringEnumerable.CreateStringWrapperForBinding().ShowInGrid(dataEditorPersister, pageSize);
             //enumerable = stringEnumerable.CreateStringWrapperForBinding();
             //readOnly = true;
             return(enumerable);
         }
         FrmDataEditor.CreateDataEditorForm(enumerable, new GridDataEditorT <T> {
             Dock = DockStyle.Fill
         }, dataEditorPersister, pageSize, readOnly).ShowDialog();
     }
     return(enumerable);
 }