'Rebind' a GridView

M

Miguel Dias Moura

Hello,

I have an Asp.Net 2.0 Grid View on a page.
I created the GridView from my ASPX.VB file, i.e., my VB code.

The GridView has 2 TemplateFields. The first TemplateField has a Label
and the second one has an Image.

After the GridView is created I need, when an action on the page is
taken, to change the GridView:

1. Change Header and Footer (I was able to to this)

2. Rebind the GridView to a dataset with changed data.

To do this I create a new DataTable and a new DataSet and bind it to
the GridView:

...

' Create new DataSet
Dim dsInfo As New DataSet
dsInfo.Tables.Add(dtInfo)

' Bind gvInfo
gvInfo.DataSource = dsInfo
gvInfo.DataBind()

I can see that the GridView gets the rows but they are empty.

In my opinion I need to access the already created label and image in
my TemplateFields and bind them to my DataSet fields.

What do you think?
The problem is I don't know how to access them and bind them to the
DataSet fields.

Can someone help me out with this?

Thank You,
Miguel
 

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

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top