How do I rebind a gridview?

N

needin4mation

In a GridView, take for example a delete button. When I click the
delete button in my GridView the GridView row is deleted and the
GridView rebinds and refreshes the records to show accurately.

Problem:

I have a GridView that has a select. This select gives a FormView
control the data to open. I set the GridView visible to false. I have
only my FormView open. This FormView is used to edit, have other
DetailsViews that open etc.

On my FormView, when I click delete (the stock button), I want to
rebind that initial GridView minus the row I just deleted.

I tried GridView1.DataBind() in the delete command of the FormView, but
it only shows the old GridView with the record I just deleted. I have
to revisit the page to get a good set of data.

I could use code and open a connection, retrieve data and databind that
way, but I didn't think I should have to do that (maybe I'm wrong).

How can I rebind my GridView like it does with its delete button?

Thank you for any help.
 
S

Shahzad Godil

I have same thing implemented in my project and GridView.Databind working
perfectly. Just verify one thing that both GridView and FormView are
bound to seperate datasource. Chat with me on msn messenger if you still
facing any error.

Shahzad Godil
Karachi-Pakistan
MSN Messenger : (e-mail address removed)
 

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