locked
Dynamically create items in a grid?

    Question

  • I'm quite new to coding so forgive me if this is a simple question:

    I want to start with a single item in a grid.
    Then when a user presses a button, a new item is added to the grid.

    How would I go about that? Thanks.

    Monday, September 24, 2012 12:54 AM

Answers

  • Hi

    You can choose a Binding.List for a datasource, then bind it to your grid.

    And in this way when you push a item to your Binding.List your grid will updated.

    Binding.List is an in-memory datasource, you need to use other datasource if you want to save it .

    Please refer to this Sample:

    http://code.msdn.microsoft.com/windowsapps/ListView-custom-data-4dcfb128

    scenario 2 and scenario 3 will show you how to use Binding.List and custom datasource.

    After you understand it, you can use it in your gird.

    Monday, September 24, 2012 2:10 AM

All replies

  • Hi

    You can choose a Binding.List for a datasource, then bind it to your grid.

    And in this way when you push a item to your Binding.List your grid will updated.

    Binding.List is an in-memory datasource, you need to use other datasource if you want to save it .

    Please refer to this Sample:

    http://code.msdn.microsoft.com/windowsapps/ListView-custom-data-4dcfb128

    scenario 2 and scenario 3 will show you how to use Binding.List and custom datasource.

    After you understand it, you can use it in your gird.

    Monday, September 24, 2012 2:10 AM
  • Thanks for pointing me in the right direction!
    Monday, September 24, 2012 1:52 PM