Regenerating a Datagrid

Discussion in 'ASP .Net Datagrid Control' started by Shahir A. Ahang, Oct 3, 2005.

  1. 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
     
    Shahir A. Ahang, Oct 3, 2005
    #1
    1. Advertising

  2. Shahir A. Ahang

    Elton Wang Guest

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

    HTH


    "Shahir A. Ahang" <> wrote in message
    news:2ca3b$43418895$c61dbf94$...
    > 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
    >
    >
     
    Elton Wang, Oct 3, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. GMartin
    Replies:
    1
    Views:
    390
    Jordan Richard
    May 4, 2005
  2. Roja
    Replies:
    1
    Views:
    348
  3. Nathan Sokalski

    Regenerating the *.aspx.designer.vb file

    Nathan Sokalski, Jan 31, 2009, in forum: ASP .Net
    Replies:
    0
    Views:
    537
    Nathan Sokalski
    Jan 31, 2009
  4. Nathan Sokalski

    Regenerating the *.aspx.designer.vb file

    Nathan Sokalski, Sep 28, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    695
    Patrice
    Sep 28, 2009
  5. Vlastimil Brom
    Replies:
    5
    Views:
    318
    Vlastimil Brom
    Nov 19, 2010
Loading...

Share This Page