471,582 Members | 1,517 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,582 software developers and data experts.

How do I rebind a gridview?

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
2 5522

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
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.

Similar topics

1 post views Thread by Eugene | last post: by
1 post views Thread by Bob Long | last post: by
2 posts views Thread by SKC | last post: by
reply views Thread by Miguel Dias Moura | last post: by
1 post views Thread by H5N1 | last post: by
reply views Thread by Microsoft News Group | last post: by
1 post views Thread by wardemon | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by Vinnie | last post: by
1 post views Thread by lumer26 | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.