CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 Item Template in DataGrid

Print topic Send  topic

Author Message
mike_19

Posts: 2
Posted: 07/27/2007, 6:30 AM

Hi, to all. I have taken a template column in a datagrid and have inserted image button as an item template. I want when the user click that button it identifies the project code which is bound column where data is coming from database. When he clicks on that image button it should identify the project code of that row and then pass that particular value to session variable and then redirect to the next page where i am using these session variables. Earlier i used select button of the datagrid and used selectedIndexchanged as an event in which i was identifying columns and passing that value to session variables and after passing those values i was redirecting to the next page.

Private Sub dg_summary_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles dg_summary.SelectedIndexChanged
Session("PName") = dg_summary.SelectedItem.Cells(0).Text
Session("PCode") = dg_summary.SelectedItem.Cells(1).Text
Response.Redirect("report.aspx")
End Sub

But this logic won't work in case of item templates. Can you tell the possible solution. The only thing i could think of is using itemcommand as event and then pass the value in e.command argument.

Private Sub dg_summary_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dg_summary.ItemCommand
e.CommandArgument(DataBinder.Eval(Container, "DataItem.Pcode"))
End Sub

can anyone send possible code to this problem.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.