get data from gridview without querying database

Posted by frank2009 on Stack Overflow See other posts from Stack Overflow or by frank2009
Published on 2009-11-11T21:58:01Z Indexed on 2010/03/28 8:03 UTC
Read the original article Hit count: 203

Filed under:
|

Hi there

I am new at this so please bear with me...

I have managed to get the following code to work...so when I click on the "select" link in each row of the gridview, the data is transfered to other label/textbox on the webpage.

So far so good, the thing is that everytime I click on select...it goes and checks on the database for the data and there is a delay of a few seconds... I was hoping that the data, since it is already visible on the gridrows, is simply "picked up" and used on other labels/textboxes...without requerying the database.

Is this possible ? Thanks in advance

Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
    Label1.Text = GridView2.SelectedRow.Cells(8).Text
    Label2.Text = GridView2.SelectedRow.Cells(9).Text
    TextBox1.Text = GridView2.SelectedRow.Cells(7).Text
End Sub

© Stack Overflow or respective owner

Related posts about gridview

Related posts about select