473,385 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 5612

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Eugene | last post by:
If I were to upgrade my application development client from V8.1.3 to V8.1.4 but the (remote) database stays at V8.1.3, should I rebind the upgraded client's utilities and CLI using @db2ubind.lst...
1
by: Dale Franklin | last post by:
This should be a rather ROUTINE procedure for you DBAs. I keep hearing at technical conferences and user groups the phrase "then rebind all your plans and packages" (after reorg, load, &...
1
by: Bob Long | last post by:
We are currently on (Solaris) UDB V7 EE with fp7 and want to get to fp 12 or 13. We also have Federated connections to multiple mainframes and data bases at DB2 7.1. Our question, upon...
2
by: SKC | last post by:
Platform : Solaris UDB : version 7.2 FP9 DB2RBIND PACKAGE SCHEMA.PACKAGE fails with SQL0029N error. When I issue, "db2rbind DBNAME all", it is successfull. Can anyone help me understand...
2
by: alex.mcshane | last post by:
Overview There are occasions when UDB Tables will have to be Dropped and Re-Created. For unaltered Stored Procedures, this should not necessitate a Recompile (i.e. Re-Registration) of the SP as...
0
by: Miguel Dias Moura | last post by:
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...
1
by: H5N1 | last post by:
Hello everybody I'm stuck for a long time with the following problem, so I will be really gratefull if you could help me a bit: I have a GridView nested in DataList (it's located in DataList's...
0
by: Microsoft News Group | last post by:
I have a grid view that adds records in the footer. When I hit the add button to add the fields, the gridview rebinds, but I have a dropdownlist that I would like to also rebind on this with the...
1
by: wardemon | last post by:
Hi, I have an image control which inside an ItemTemplate of a GridView Control. I've coded the ImageControl's ImageURL in "Source" to have a dynamically filled-up value ex: ImageURL = <%#...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.