i would like to call some particular record from one column of gridview from one page1 to another new page,for example:price column in page one,i would like to display the price column value in page2.any idea?
![]() |
0 |
![]() |
Hello,
You can pass values from a gridview to another page using a hyperlink field for that particular column. Within the hyperlink control there is a value you can set in DataNavigateUrlFormatString.
I can remember the make up of the what u enter but search for that and there be loads of pages explaining.
Hope this helps.
Kevin
![]() |
0 |
![]() |
i don really understand what does u mean...can u explain in more detail please?and also i cannot found DataNavigateUrlFormatString in hyperlink.thx
![]() |
0 |
![]() |
Are you trying to send one value to page 2 or the whole column/row of values? If you're just sending one value you could use a querystring to pass it.
![]() |
0 |
![]() |
Hi,
Say if u click on a Edit button/link in a grid view.
Just go to the code behind and inside the
Protected Sub GridView1_RowEditing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GridView1.RowEditing
procedure write the following code
price= GridView.Rows(e.NewEditIndex).Cells("index of price col").Text
resposne .redirect("page2url?price="&price)
In the page2 to get the values of price
if not Request.QueryString("price") is nothing then
var=Request.QueryString("price")
end if
Here price is sent from one page to another.
So hope so this will help U..
Regards,
Srinivas Ramanujan
Words offer the means to meaning, and for those who will listen, the enunciation of truth !!!!!
![]() |
0 |
![]() |
DataNavigateUrlFormatString can be found if u r adding a Hyperlink column from the EditTemplate section of the grid.
here u can pass the value as a string.Basically the bottomline is to pass it as a querystring.
Cheers
Bino
www.codepal.co.in
Please Mark as Answer if you find the post useful.
![]() |
0 |
![]() |
how to use the DataNavigateURlFormatString:-
add hyperlink field into your gridview as below
<asp:HyperLinkField DataTextField="Field1" HeaderText="Field1" DataNavigateUrlFields="Field1" SortExpression="Field1" DataNavigateUrlFormatString="Newpage.aspx?Field1_ID={0}" > </asp:HyperLinkField>
Which value you click on that particular coulmn will pass over in the url on the Page_load event for your new page you can pick up the value passed when clicking on the hyperlink like this
Dim ValueFromLastPage As String = Request("Field1_ID")
Hope this is a bit clearer.
Regards
Kevin
![]() |
0 |
![]() |