DataGrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi! All..

I ahve a query related to DataGrid. I used DataReader to populate the DataGrid and it has a Hyperlink Column. On click of the hyperlink i want to pass the complete Row value to another page and print it there.. How do i Do it

Thanks
Baren
 
Either you add all the values to the Hyperlink and let the user click on
the link and navigate to the next page and then you have to parse the
Querystring collection to get to the values. You also have the option of
opening this in a new Window etc

OR

Change the Hyperlink to and Edit Button (DataGrid) and then on the
EditCommand event you can parse the Row and send it to the page you
would like to call.
This later step can also be changed to make the values as form Level
Property values and refer from the next page using a Server.Transfer.
Let me know if you need more iformation on this.

Regards,

Trevor Benedict R

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Hi Baren,

you can pass the values as querystring
how to do it ??
in datagrid's itemdatabound build the the url for the hyperlink

HTH
Regards
Ashish M Bhonkiya

Baren said:
Hi! All..

I ahve a query related to DataGrid. I used DataReader to populate the
DataGrid and it has a Hyperlink Column. On click of the hyperlink i want to
pass the complete Row value to another page and print it there.. How do i Do
it
 
Hi! Trevor,

Well its nice to pass the values in a querystring when the content size is less, but for heavy data like "Text".. it will be difficult to pass it through the querystring.

Baren
 
Then See if this is useful to you.

In the page which I display first, I have a Property like this.

Public ReadOnly Property SelectedValue() As String
Get
If lstResult.SelectedIndex <> -1 Then
Return lstResult.SelectedValue
Else
Return ""
End If
End Get
End Property

When the User Navigate to the next page (not a Hyper Link). this is a
Button Object. So On click of that button, I do a Server.Transfer like
this

Server.Transfer("SomePage.Aspx")

In this SomePage.Aspx in the Page_Load Event & if is not a Postback then
I do this

Dim SourePage1 As THEACTUALPAGENAMEHERE
Try
SourePage1 = CType(context.Handler,
THEACTUALPAGENAMEHERE)
strSelectedValue = SourePage1.SelectedValue

Catch Ex as Exception
End Try

HTH

Trevor Benedict R
MCSD


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Back
Top