Blank DataGrid

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Eric

    #1

    Blank DataGrid

    Is it possible to start with a blank datagrid and enter the information like an excel spread sheet? This doesn't seem to be the case. If it doesn't work that way, is there another control I can use other than inserting a spread sheet?
  • William Ryan

    #2
    Re: Blank DataGrid

    You could create a DataTable with however many columns you wanted to show
    and bind the grid to it. Just declare a DataGrid, then Add three or four
    (or whatever) DataColumns to it. If you want x amount of rows by default,
    then just iterate through a counter and add a New DataRow each time.

    HTH,

    Bill
    "Eric" <anonymous@disc ussions.microso ft.com> wrote in message
    news:D06480BB-9CAB-496A-BD26-733CB7BF8DA2@mi crosoft.com...[color=blue]
    > Is it possible to start with a blank datagrid and enter the information[/color]
    like an excel spread sheet? This doesn't seem to be the case. If it
    doesn't work that way, is there another control I can use other than
    inserting a spread sheet?


    Comment

    • Mitchell Geere

      #3
      Re: Blank DataGrid

      Well,

      The DataTable is a good idea but for performance simply create a DataTable
      with 1 row and A through X columns (when X is reached have an event create
      AA - AX... and so on) then on a DataGrid you will have an * which will allow
      you to add to the DataGrid... when the user is done he can then press "Save"
      and then you save the DataTable to a CSV or to a DB, or whatever datastorage
      you want o use (XML is also an option)

      Mitch

      "William Ryan" <dotnetguru@com cast.nospam.net > wrote in message
      news:uYzXf4HsDH A.3456@tk2msftn gp13.phx.gbl...[color=blue]
      > You could create a DataTable with however many columns you wanted to show
      > and bind the grid to it. Just declare a DataGrid, then Add three or four
      > (or whatever) DataColumns to it. If you want x amount of rows by default,
      > then just iterate through a counter and add a New DataRow each time.
      >
      > HTH,
      >
      > Bill
      > "Eric" <anonymous@disc ussions.microso ft.com> wrote in message
      > news:D06480BB-9CAB-496A-BD26-733CB7BF8DA2@mi crosoft.com...[color=green]
      > > Is it possible to start with a blank datagrid and enter the information[/color]
      > like an excel spread sheet? This doesn't seem to be the case. If it
      > doesn't work that way, is there another control I can use other than
      > inserting a spread sheet?
      >
      >[/color]


      Comment

      Working...