Re: Rebind data source in GridView



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@xxxxxxxx> escreveu na mensagem
news:ueIarnOVGHA.5660@xxxxxxxxxxxxxxxxxxxxxxx
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


.



Relevant Pages

  • RE: paging with gridview
    ... When you bind the GridView to a datasource that is not a DataSourceControl ... Protected Sub GridView2_PageIndexChanging(ByVal sender As Object, ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: paging with gridview
    ... When you bind the GridView to a datasource that is not a DataSourceControl ... Protected Sub GridView2_PageIndexChanging(ByVal sender As Object, ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: paging with gridview
    ... When you bind the GridView to a datasource that is not a DataSourceControl ... Protected Sub GridView2_PageIndexChanging(ByVal sender As Object, ...
    (microsoft.public.dotnet.framework.aspnet)
  • ObjectDataSource .net 2.0
    ... I'm using a gridview with a embedded dropdownlist and a objectDatasource as ... Now I need to assign this to the datasource represented ... ddlRole is my embedded dropdown in my ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Problem understanding how to create a dynamic GridView in C#
    ... ObjectDataSource). ... add the datasource it works correctly. ... // if the new GridView() control is replaced with the ... // aspx page, the grid gets poplulated as exptected. ...
    (microsoft.public.dotnet.framework.aspnet.datagridcontrol)