Overriding GridView Using LinqDataSource

I have a gridview that uses a LinqDataSource for this data source. I added a FooterTemplate so that users can insert new records. The Add button has a command name that places the values ​​in the Dictionary list and then calls the LinqDataSource.Insert () method. This works great. But the gridview is never automatically updated with a new row. I am using the LinqDataSource.Selecting event for initial data binding. I tried LinqDataSource.Bind () and GridView.Bind () but the gridview never gets updated. Any idea how to restore the GridView?

Note. I am not using UpdateDate panel, just postback / update without ajax

+1


source to share


1 answer


Once the solution that worked was as follows:



  • Add logic to define DataSourceID for GridView in CodeBehind
  • Call function after Insert () method
0


source







All Articles