Regenerating a Datagrid

  • Thread starter Shahir A. Ahang
  • Start date
S

Shahir A. Ahang

All,

I am wondering if there is a way to regenerate a datagrid which has already
been bound to a dataset WITHOUT having to re-query the data source.

In my page, I have a drop-down control which is populated through a SQL
query. Once the user selects a value from the drop-down, the datagrid is
generated. I have included in the datagrid a ButtonColumn to remove
unwanted rows:

<asp:ButtonColumn CommandName="Delete" HeaderText="Remove"
ButtonType="LinkButton" Text="Remove" />

Now, when the user clicks on "Remove" for any row in the datagrid, I simply
want to remove the row from the datagrid and regenerate the datagrid without
having to make another query to the data source. Essentially I want
manipulate the existing datagrid object and regenerate it without having to
re-query the database.

Any assistance would be greatly appreciated.

Shahir
 
E

Elton Wang

Save the query result, e.g. DataTable, in Session. The retrieve it from
Session and cast to datatable (or whatever type it is).

HTH
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top