By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,025 Members | 2,118 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,025 IT Pros & Developers. It's quick & easy.

How do I rebind a gridview?

P: n/a
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.

Oct 18 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a

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 : sh*********@hotmail.com

<ne***********@gmail.comwrote in message
news:11**********************@e3g2000cwe.googlegro ups.com...
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.

Oct 19 '06 #2

P: n/a
jm
I moved my GridView1.DataBind(); to the ItemDeleted event of the
FormView.
Shahzad Godil wrote:
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 : sh*********@hotmail.com

<ne***********@gmail.comwrote in message
news:11**********************@e3g2000cwe.googlegro ups.com...
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.
Oct 19 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.