Microsoft
Software
Hardware
Network
Question : find gridview row value when checkbox is selected
Hi i need to find the value of a row in a gridview depending what checkbox is selected and pass it to another page.Here is what i have so far that works for one but if i have two it doesn't find the second value
<asp:GridView GridLines="None" ID="GridView" DataSourceID="XmlDataSourc
e" runat="server" Width="700px" AutoGenerateColumns="false
">
<AlternatingRowStyle/>
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="Type_Label" runat="server" class="pdheading" Text='<%# XPath("Type") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="Amount_Label" runat="server" Text='<%# XPath("Amount") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="Currency_Label" runat="server" Text='<%# XPath("Currency") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="Checkbox" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="Description_Label" runat="server" CssClass="contactform" Text='<%# XPath("Description">'></as
p:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<tr>
<td align="center" colspan="3">
<asp:Button ID="Step1Button" Text="Finalize" ValidationGroup="Group1" runat="server" OnClick="Step1_ButonClick"
/>
</td>
</tr>
protected void Step1_ButonClick(object sender, EventArgs e)
{
GridView GridView = (GridView)Form.FindControl
("GridView
");
for (int e = 0; e < GridView.Rows.Count; e++)
{
Label Type_Label = (Label)GridView.Rows[e].Fi
ndControl(
"Type_Labe
l");
CheckBox Checkbox = (CheckBox)GridView.Rows[e]
.FindContr
ol("Checkb
ox");
{
if (Type_Label.Text == ("Cars"))
{
Session["Cars"] = (ExtraCostsCheckbox.Checke
d);
}
else
{
}
if (NKType_Label.Text == ("Bikes"))
{
Session["Bikes"] = (Checkbox.Checked);
}
else
{
}
Response.Redirect("/Page2.
aspx");
}
}
}
This finds the value true or false if the Cars row checkbox is selected or not and it creates the session but fails on the second.Is there a way to acheive this?
Answer : find gridview row value when checkbox is selected
The new version of Java removes all previous versions. The only other query to use is a subselect (NOT) query.
http://www.myitforum.com/a
rticles/1/
view.asp?i
d=179
Random Solutions
Monitor CIsco 6500 Switch Fabric and Backplane Utilization
can#t Compile PNG Image Lib
How to get an USB speaker to work with Eee PC 900 Xandros Linux
I need to query each group in an OU in the Root Domain and get the group names that has exact identical users.
red ant
How do I configure exchange 2007 to allow iPhone/iPad to work.
vb.net Insert comma every 3 characters
InDesign/MAC PrintBooklet to a PDF file on a mac
Globally Hide Mouse after Inactive without using constantly running Timer Interval
how to add swap partition to exsting swap in redhat linux