DataGrid Template Columns At Runtime

Discussion in 'ASP .Net Web Controls' started by Davey P, Jun 10, 2005.

  1. Davey P

    Davey P Guest

    I have a datagrid and am populating it with template columns dynamically at
    runtime. I have created a class that inherits ITemplate and populates the
    cells with a Drop Down List in the InstantiateIn() method. I don't have an
    edit mode, basically any of the selections in drop down lists can be changed
    at any time. This leaves me with the problem that on every post back I need
    to save EVERY ddl's data back to my bound datatable. I placed a method in
    page load to loop through all my datagrid items and save them back to my
    datatable, but when my method is triggered, the column count for my datagrid
    reads 0. I guess its something to do with dynamically adding columns, but am
    unsure as to how to go about fixing it. Any help would be greatly appreciated.
    Davey P, Jun 10, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGF2ZXkgUA==?=

    Datagrid Template Columns At Runtime

    =?Utf-8?B?RGF2ZXkgUA==?=, Jun 10, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    460
    =?Utf-8?B?RGF2ZXkgUA==?=
    Jun 10, 2005
  2. =?Utf-8?B?QW5kcmV3?=

    DetailsView - Create Template Columns at Runtime

    =?Utf-8?B?QW5kcmV3?=, Nov 28, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    715
    =?Utf-8?B?QW5kcmV3?=
    Nov 28, 2005
  3. rob thomson
    Replies:
    0
    Views:
    260
    rob thomson
    Sep 4, 2003
  4. Daniel Roth
    Replies:
    0
    Views:
    253
    Daniel Roth
    Apr 5, 2005
  5. Vinki

    template columns and bound columns in gridview

    Vinki, Apr 25, 2007, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    858
    Vinki
    Apr 25, 2007
Loading...

Share This Page