all groups > asp.net datagrid control > march 2006 >
You're in the

asp.net datagrid control

group:

Rebind data source in GridView


Rebind data source in GridView Andrei Varanovich
3/31/2006 8:38:25 PM
asp.net datagrid control:
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!
Re: Rebind data source in GridView Bruno Alexandre
4/10/2006 12:11:38 PM
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...
--


Bruno Alexandre
(a Portuguese in Denmark)

"Andrei Varanovich" <Andrei_Varanovich@epam.com> escreveu na mensagem
news:ueIarnOVGHA.5660@TK2MSFTNGP12.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button