Rebind data source in GridView

A

Andrei Varanovich

Hello all!

I have a button on a form alongside a GridView with ObjectDataSource,
and the effect of the button need to be the modifying the underlying
database (it changes some cells' values in the objects being displayed
by the GridView).

How can I rebind the data in code? For now I see that simple call like
GridView1.DataBind() in button click event handler doesn't make any
effects on the page.

Thanks in advance!
Andrei
 
B

Bruno Alexandre

You need to update the datasource and then bind it again, and it will show
you the correct values...

sub btnOne_Click( ...

updateDataSource()
GridView1.DataBind()

end sub


if this isn't working that because you are not updating the DataSource at
all...
 

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
474,002
Messages
2,570,261
Members
46,858
Latest member
FlorrieTuf

Latest Threads

Top