Gridview dynamic columns

J

jimmysjams

I'm modifying someone else's code and I have hit a snag. I don't
want
to rewrite what's already there but I might have to.

I have a gridview, in the gridview is a set number of columns that
will always be there. On the end of the gridview I need to add
columns
dynamically. These columns may or may not exist and I don't know how
many there will be. The way it is currently programmed, there are 2
gridviews, one for viewing a list and one for editing the list. So
the gridview is either being editted or it's being viewed. The way
the editted gridview is saved is by looping through each row, finding
the value in certain controls, and saving a list generated with the
values extracted.


Here's the problem, I can add and view columns in both gridviews by
adding new table cells to each row, but when I go to extract the
values within the code of the process described above, the gridview
doesn't have the additional columns. My question is, how do I add a
control to a gridview after it has been bound and then extract the
value from it? I'd prefer to not rewrite what's already there and
working, but is there an easier or better way to accomplish the same
goal? Thank you for your help in advance.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top