How to select and hyperlink the contents of a row in a grid view dynamically
-
Hi How can I select and hyperlink the contents of a row in a gridview server control dynamically.I want the contents of the selected row to be transferred to the next page(using the hyerlink). ANy onwe who can help me? thanks kidus
What do you mean, dynamically? At runtime on the client-side? Right some javascript to handle the mouseover event on the row. Server-side? Use a template.
only two letters away from being an asset
-
What do you mean, dynamically? At runtime on the client-side? Right some javascript to handle the mouseover event on the row. Server-side? Use a template.
only two letters away from being an asset
-
hi I mean at ruutime and on the server side.I wrote using mouseover on the client side but it doesn't hyperlink? Can y show me on both?server side and client side scripting? thanks kidus
Server-side is easy, like I said you need to use a template. See the template columns section in this article. http://www.codeproject.com/aspnet/datagriddemo.asp[^] If you create a hyperlink using the above method there is no need to use client-side scripting.
kidus1 wrote:
I wrote using mouseover on the client side but it doesn't hyperlink?
Explain what your tried. So some code.
only two letters away from being an asset
-
Server-side is easy, like I said you need to use a template. See the template columns section in this article. http://www.codeproject.com/aspnet/datagriddemo.asp[^] If you create a hyperlink using the above method there is no need to use client-side scripting.
kidus1 wrote:
I wrote using mouseover on the client side but it doesn't hyperlink?
Explain what your tried. So some code.
only two letters away from being an asset
-
hi I created a clickable gridview control but I can't hyperlink to other page.I am trying to do this using Javascripts. Any help? thanks kidus
kidus12 wrote:
Any help?
Show the code you are using, then maybe we can help. I don't understand how are you creating this "clickable gridview" in javascript?
only two letters away from being an asset
-
Hi How can I select and hyperlink the contents of a row in a gridview server control dynamically.I want the contents of the selected row to be transferred to the next page(using the hyerlink). ANy onwe who can help me? thanks kidus
-
kidus12 wrote:
Any help?
Show the code you are using, then maybe we can help. I don't understand how are you creating this "clickable gridview" in javascript?
only two letters away from being an asset
hi here is the code for creating the clickable Row using Javascript if (e.Row.DataItemIndex == -1) return; e.Row.Attributes.Add("onMouseOver", "this.style.cursor='hand';"); e.Row.Attributes["onmouseover"] = "javascript:setMouseOverColor(this);"; e.Row.Attributes["onmouseout"] = "javascript:setMouseOutColor(this);"; e.Row.Attributes.Add("onclick", this.GetPostBackClientEvent(GrdDynamic, "Select$" + e.Row.RowIndex.ToString())); and what I want to do is to hyperlink to other page when the row in the clickable gridview is clicked and passed the contents of the clicked row to the other page(using session). thanks kidus
-
hi here is the code for creating the clickable Row using Javascript if (e.Row.DataItemIndex == -1) return; e.Row.Attributes.Add("onMouseOver", "this.style.cursor='hand';"); e.Row.Attributes["onmouseover"] = "javascript:setMouseOverColor(this);"; e.Row.Attributes["onmouseout"] = "javascript:setMouseOutColor(this);"; e.Row.Attributes.Add("onclick", this.GetPostBackClientEvent(GrdDynamic, "Select$" + e.Row.RowIndex.ToString())); and what I want to do is to hyperlink to other page when the row in the clickable gridview is clicked and passed the contents of the clicked row to the other page(using session). thanks kidus
You are trying to make it more difficult than it is. Use a template column or Hyperlink column to create the link, pass the id of the row to the next page and retrieve the row data from the datasource on that page.
only two letters away from being an asset
-
You are trying to make it more difficult than it is. Use a template column or Hyperlink column to create the link, pass the id of the row to the next page and retrieve the row data from the datasource on that page.
only two letters away from being an asset
-
I already have. Figure it out. It isn't that difficult.:rolleyes:
only two letters away from being an asset