I have a table with many dropdownlist.I need values from those dropdownlists to be calculated later in a label.But I did a debug step by step the if clauses are not being read .
Your idea seems to be my solution .I tried but it fires an error: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: index
And for extra information my table1 is created dynamically
Regards
Please 'Mark as Answer' if my post is helpful for you.
Will you Please explain very briefly what do you try to do?
You have a GridView. In each row there are many DropDownLists and a CheckBox. And You have a Table out side GridView
Looping thrugh the gridview rows, in each row you loop through all the rows of the table and doing some calculation using value of that row and next row and the selected values of the some of the DropDownLists and assigning values to some variables....
Please complete this......
Also please tell me What is
rowgridview++;
Kindly mark this post as "Answer", if it helped you.
When I select for example 3 rows in gridview i click in a button and a table1 is created dynamically (numbers of checked rows in gridview are number of rows in table1)
After that i select some value of each row in table1 and compare values of each row to calculate a value and affect it to label3
That's it
The error is that like the table1 is empty and loose its values in postback i think
Hope i was clear
Regards
Please 'Mark as Answer' if my post is helpful for you.
Yosr Jemili
Member
2 Points
13 Posts
Data in TableRow are not being read
Apr 07, 2012 05:31 PM|LINK
Hello
I have a table with many dropdownlist.I need values from those dropdownlists to be calculated later in a label.But I did a debug step by step the if clauses are not being read .
Here's my code :
protected void Button2_Click(object sender, EventArgs e) { foreach (TableRow rowtable in Table1.Rows) { if (Convert.ToInt32(rowtable.Cells[1].Text) >= Convert.ToInt32(rowtable.Cells[1].Text)) { confselect = Convert.ToInt32(rowtable.Cells[1].Text); } else { confselect = Convert.ToInt32(rowtable.Cells[1].Text); } if (Convert.ToInt32(rowtable.Cells[2].Text) >= Convert.ToInt32(rowtable.Cells[2].Text)) { integselect = Convert.ToInt32(rowtable.Cells[2].Text); } else { integselect = Convert.ToInt32(rowtable.Cells[2].Text); } if (Convert.ToInt32(rowtable.Cells[3].Text) >= Convert.ToInt32(rowtable.Cells[3].Text)) { dispselect = Convert.ToInt32(rowtable.Cells[3].Text); } else { dispselect = Convert.ToInt32(rowtable.Cells[3].Text); } if (Convert.ToInt32(rowtable.Cells[6].Text) >= Convert.ToInt32(rowtable.Cells[6].Text)) { vraisemselect = Convert.ToInt32(rowtable.Cells[6].Text); } else { vraisemselect = Convert.ToInt32(rowtable.Cells[6].Text); } Label3.Text = Convert.ToString((confselect + integselect + dispselect) * vraisemselect * 4); } }Thanks in advance
Regards
TableRow
YosrJ
mm10
Contributor
6439 Points
1184 Posts
Re: Data in TableRow are not being read
Apr 07, 2012 05:35 PM|LINK
Do you mean that Table1.Rows contains no TableRows? Is Table1.Rows.Count equal to 0?
Yosr Jemili
Member
2 Points
13 Posts
Re: Data in TableRow are not being read
Apr 07, 2012 05:38 PM|LINK
Thanks mm10 for the quick reply
No what i meant is that the if clause is not executed in the code
The table1.rows contains rows but the value in label3.text is 0
my code snippet was like that :
protected void Button2_Click(object sender, EventArgs e) { rowgridview = 0; foreach (GridViewRow row in GridView1.Rows) { CheckBox chk = (CheckBox)row.FindControl("CheckBox1"); if (chk.Checked) { rowgridview++; } } for (i = 0; i < rowgridview ;i++ ) { if (Convert.ToInt32(Table1.Rows[i].Cells[1].Text ) >=Convert.ToInt32(Table1.Rows[i + 1].Cells[1].Text)) { confselect = Convert.ToInt32(Table1.Rows[i].Cells[1].Text); } else { confselect = Convert.ToInt32(Table1.Rows[i+1].Cells[1].Text); } if (Convert.ToInt32(Table1.Rows[i].Cells[2].Text) >= Convert.ToInt32(Table1.Rows[i + 1].Cells[2].Text)) { integselect = Convert.ToInt32(Table1.Rows[i].Cells[2].Text); } else { integselect = Convert.ToInt32(Table1.Rows[i+1].Cells[2].Text); } if (Convert.ToInt32(Table1.Rows[i].Cells[3].Text) >= Convert.ToInt32(Table1.Rows[i + 1].Cells[3].Text)) { dispselect = Convert.ToInt32(Table1.Rows[i].Cells[3].Text); } else { dispselect = Convert.ToInt32(Table1.Rows[i+1].Cells[3].Text); } if (Convert.ToInt32(Table1.Rows[i].Cells[6].Text) >= Convert.ToInt32(Table1.Rows[i + 1].Cells[6].Text)) { vraisemselect = Convert.ToInt32(Table1.Rows[i].Cells[6].Text); } else { vraisemselect = Convert.ToInt32(Table1.Rows[i+1].Cells[6].Text); } } Label3.Text = Convert.ToString((confselect + integselect + dispselect) * vraisemselect * 4); }YosrJ
Bimalvv
Contributor
2356 Points
478 Posts
Re: Data in TableRow are not being read
Apr 07, 2012 05:45 PM|LINK
You need to extract the dropdown and try to get the value for conversion
var res = rowtable.Cells[1].FindControl("DropDownList2") as DropDownList; confselect = Convert.ToInt32(res.SelectedValue);Bimal
Yosr Jemili
Member
2 Points
13 Posts
Re: Data in TableRow are not being read
Apr 07, 2012 06:15 PM|LINK
Thanks bimalv.
Your idea seems to be my solution .I tried but it fires an error: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: index
And for extra information my table1 is created dynamically
Regards
YosrJ
Bimalvv
Contributor
2356 Points
478 Posts
Re: Data in TableRow are not being read
Apr 07, 2012 07:02 PM|LINK
In which cell you have your dropdownlist? Basically the index starts from zero.
rowtable.Cells[0].FindControl("DropDownList2") as DropDownList;If you can share the markup I can provide more details
Bimal
basheerkal
Star
10672 Points
2426 Posts
Re: Data in TableRow are not being read
Apr 08, 2012 10:13 AM|LINK
I cannot get the logic. Comparing the text values in same cell of the row?
Will you please explain it
(Talk less..Work more)
Yosr Jemili
Member
2 Points
13 Posts
Re: Data in TableRow are not being read
Apr 09, 2012 11:03 PM|LINK
Hi
Thx bimalv for your help:
In fact the table1 is created dynamically
Thx basheerkal for your answer and sorry for the disturb you're right.My real logic is that line:
if (Convert.ToInt32(Table1.Rows[i].Cells[1].Text ) >=Convert.ToInt32(Table1.Rows[i + 1].Cells[1].Text)) { confselect = Convert.ToInt32(Table1.Rows[i].Cells[1].Text); }my Goal is to compare 2 rows and for sure not one row
My whole code and markup :
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Collections; using System.Data; public partial class GESTION_DU_RISQUE_GRA : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Label4.Text = "scénarios"; Label5.Text = "C"; Label6.Text = "I"; Label7.Text = "D"; Label8.Text = "Conséquences"; Label9.Text = "Mesures_Existantes"; Label10.Text = "Vrai_Semblance"; } } protected void DropDownList2_SelectedIndexChanged1(object sender, EventArgs e) { if (DropDownList2.SelectedValue == "D") AccessDataSource2.SelectCommand = "SELECT * FROM Scenarios where IndiceScénario = 'F111'" ; GridView1.DataBind(); } int i,confselect,dispselect,integselect,vraisemselect,rowgridview; protected void Button2_Click(object sender, EventArgs e) { rowgridview = 0; foreach (GridViewRow row in GridView1.Rows) { CheckBox chk = (CheckBox)row.FindControl("CheckBox1"); if (chk.Checked) { rowgridview++; } } for (i = 1; i < rowgridview ;i++ ) { if (Convert.ToInt32((Table1.Rows[i].Cells[2].FindControl("DropDownList4") as DropDownList).SelectedValue) >= Convert.ToInt32((Table1.Rows[i+1].Cells[2].FindControl("DropDownList4") as DropDownList).SelectedValue)) { confselect = Convert.ToInt32((Table1.Rows[i].Cells[2].FindControl("DropDownList4") as DropDownList).SelectedValue); } else { confselect = Convert.ToInt32((Table1.Rows[i].Cells[1].FindControl("DropDownList4") as DropDownList).SelectedValue); ; } if (Convert.ToInt32(Table1.Rows[i].Cells[2].Text) >= Convert.ToInt32(Table1.Rows[i + 1].Cells[2].Text)) { integselect = Convert.ToInt32(Table1.Rows[i].Cells[2].Text); } else { integselect = Convert.ToInt32(Table1.Rows[i+1].Cells[2].Text); } if (Convert.ToInt32(Table1.Rows[i].Cells[3].Text) >= Convert.ToInt32(Table1.Rows[i + 1].Cells[3].Text)) { dispselect = Convert.ToInt32(Table1.Rows[i].Cells[3].Text); } else { dispselect = Convert.ToInt32(Table1.Rows[i+1].Cells[3].Text); } if (Convert.ToInt32(Table1.Rows[i].Cells[6].Text) >= Convert.ToInt32(Table1.Rows[i + 1].Cells[6].Text)) { vraisemselect = Convert.ToInt32(Table1.Rows[i].Cells[6].Text); } else { vraisemselect = Convert.ToInt32(Table1.Rows[i+1].Cells[6].Text); } } Label3.Text = Convert.ToString((confselect + integselect + dispselect) * vraisemselect * 4); } protected void Button1_Click(object sender, EventArgs e) { DataTable dt = new DataTable(); dt.Columns.Add(); DataRow drr = dt.NewRow(); TableRow tabel = new TableRow(); { TableCell celul = new TableCell(); celul.Controls.Add(Label4); Label4.Visible = true; tabel.Cells.Add(celul); TableCell celul1 = new TableCell(); celul1.Controls.Add(Label5); Label5.Visible = true; tabel.Cells.Add(celul1); TableCell celul2 = new TableCell(); celul2.Controls.Add(Label6); Label6.Visible = true; tabel.Cells.Add(celul2); TableCell celul3 = new TableCell(); celul3.Controls.Add(Label7); Label7.Visible = true; tabel.Cells.Add(celul3); TableCell celul4 = new TableCell(); celul4.Controls.Add(Label8); Label8.Visible = true; tabel.Cells.Add(celul4); TableCell celul5 = new TableCell(); celul5.Controls.Add(Label9); Label9.Visible = true; tabel.Cells.Add(celul5); TableCell celul6 = new TableCell(); celul6.Controls.Add(Label10); Label10.Visible = true; tabel.Cells.Add(celul6); } Table1.Rows.Add(tabel); foreach (GridViewRow row in GridView1.Rows) { CheckBox chk = (CheckBox)row.FindControl("CheckBox1"); if (chk.Checked) { DataRow dr = dt.NewRow(); TableRow tabela = new TableRow(); DropDownList Confidentialité = new DropDownList(); Confidentialité.DataSource = AccessDataSource4; Confidentialité.ID = "DropDownList4"; Confidentialité.Items.Clear(); Confidentialité.Items.Add(""); Confidentialité.AppendDataBoundItems = true; Confidentialité.DataTextField = "Niveau_du_besoin"; Confidentialité.DataValueField = "Niveau_du_besoin"; Confidentialité.DataBind(); //Label12.Text = Confidentialité.SelectedValue.ToString(); if (!IsPostBack) { Confidentialité.ClearSelection(); } DropDownList Disponibilité = new DropDownList(); Disponibilité.DataSource = AccessDataSource10; Disponibilité.ID = "DropDownList5"; Disponibilité.Items.Clear(); Disponibilité.Items.Add(""); Disponibilité.AppendDataBoundItems = true; Disponibilité.DataTextField = "Niveau_du_besoin"; Disponibilité.DataValueField = "Niveau_du_besoin"; Disponibilité.DataBind(); if (!IsPostBack) { Disponibilité.ClearSelection(); } DropDownList Integrité = new DropDownList(); Integrité.DataSource = AccessDataSource5; Integrité.ID = "DropDownList10"; Integrité.Items.Clear(); Integrité.Items.Add(""); Integrité.AppendDataBoundItems = true; Integrité.DataTextField = "Niveau_du_besoin"; Integrité.DataValueField = "Niveau_du_besoin"; Integrité.DataBind(); if (!IsPostBack) { Integrité.ClearSelection(); } DropDownList Conséquences = new DropDownList(); Conséquences.DataSource = AccessDataSource11; Conséquences.ID = "DropDownList11"; Conséquences.Items.Clear(); Conséquences.Items.Add(""); Conséquences.AppendDataBoundItems = true; Conséquences.DataTextField = "consequence"; Conséquences.DataValueField = "consequence"; Conséquences.DataBind(); TextBox tc = new TextBox(); tc.ID = "TextBox2" ; tc.TextMode = TextBoxMode.MultiLine ; tc.Text = tc.Text + Environment.NewLine + Conséquences.SelectedValue.ToString(); if (!IsPostBack) { Conséquences.ClearSelection(); } DropDownList Mesures_Existantes = new DropDownList(); Mesures_Existantes.DataSource = AccessDataSource12; Conséquences.ID = "DropDownList12"; Mesures_Existantes.Items.Clear(); Mesures_Existantes.Items.Add(""); Mesures_Existantes.AppendDataBoundItems = true; Mesures_Existantes.DataTextField = "Mesure"; Mesures_Existantes.DataValueField = "Mesure"; Mesures_Existantes.DataBind(); Mesures_Existantes.Width =200; TextBox tcc = new TextBox(); tcc.ID = "TextBox3"; tcc.TextMode = TextBoxMode.MultiLine; if (!IsPostBack) { Mesures_Existantes.ClearSelection(); } DropDownList Vrai_Semblance = new DropDownList(); Vrai_Semblance.DataSource = AccessDataSource13; Vrai_Semblance.Items.Clear(); Vrai_Semblance.Items.Add(""); Vrai_Semblance.AppendDataBoundItems = true; Vrai_Semblance.DataTextField = "Niveau_du_vraisemblance"; Vrai_Semblance.DataValueField = "Niveau_du_vraisemblance"; Vrai_Semblance.DataBind(); if (!IsPostBack) { Vrai_Semblance.ClearSelection(); } { TableCell celula = new TableCell(); celula.Controls.Add(new LiteralControl((row.Cells[1].Text))); tabela.Cells.Add(celula); TableCell celula1 = new TableCell(); celula1.Controls.Add((Confidentialité)); tabela.Cells.Add(celula1); TableCell celula2 = new TableCell(); celula2.Controls.Add((Disponibilité)); tabela.Cells.Add(celula2); TableCell celula3 = new TableCell(); celula3.Controls.Add((Integrité)); tabela.Cells.Add(celula3); TableCell celula4 = new TableCell(); celula4.Controls.Add(Conséquences); celula4.Controls.Add(tc); tabela.Cells.Add(celula4); TableCell celula5 = new TableCell(); celula5.Controls.Add(Mesures_Existantes); celula5.Controls.Add(tcc); tabela.Cells.Add(celula5); TableCell celula6 = new TableCell(); celula6.Controls.Add(Vrai_Semblance); tabela.Cells.Add(celula6); Table1.Rows.Add(tabela); } } } DataRow dr1 = dt.NewRow(); TableRow tabela1 = new TableRow(); }The markup:
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="GRA.aspx.cs" Inherits="GESTION_DU_RISQUE_GRA" %> <asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server"> <asp:Label ID="Label1" runat="server" Text="NOM APPLICATION" style="color: #0033CC"></asp:Label> <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="AccessDataSource1" DataTextField="column1" DataValueField="column1"> </asp:DropDownList> <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="C:\Users\dell\Downloads\GestionRisquee.mdb" SelectCommand="SELECT [Nom de l'application] AS column1 FROM [Actifs de type APPLICATION]"> </asp:AccessDataSource> <p></p> <asp:Label ID="Label2" runat="server" Text="Critères d'Impact" style="font-style: italic; color: #0033CC"></asp:Label> <asp:DropDownList ID="DropDownList2" runat="server" style="margin-left: 21px" onselectedindexchanged="DropDownList2_SelectedIndexChanged1" AutoPostBack="True"> <asp:ListItem Value="C"></asp:ListItem> <asp:ListItem Value="I"></asp:ListItem> <asp:ListItem Value="D"></asp:ListItem> <asp:ListItem Value="CI"></asp:ListItem> <asp:ListItem Value="CD"></asp:ListItem> <asp:ListItem Value="ID"></asp:ListItem> <asp:ListItem Value="CID"></asp:ListItem> </asp:DropDownList> <p></p> <asp:GridView ID="GridView1" runat="server" CellPadding="4" AutoGenerateColumns="False" style="margin-right: 18px" ForeColor="#333333" GridLines="None" DataKeyNames="IndiceScénario" AllowPaging="True" AllowSorting="True" DataSourceID="AccessDataSource2"> <AlternatingRowStyle BackColor="White"/> <Columns> <asp:BoundField DataField="IndiceScénario" HeaderText="Indice Scénario" ReadOnly="True" SortExpression="IndiceScénario" /> <asp:BoundField DataField="NomScénario" HeaderText="Nom Scénario" SortExpression="NomScénario" /> <asp:BoundField DataField="IndiceSousFamille" HeaderText="Indice Sous Famille" SortExpression="IndiceSousFamille" /> <asp:BoundField DataField="IndiceFamille" HeaderText="Indice Famille" SortExpression="IndiceFamille" /> <asp:TemplateField> <EditItemTemplate> <asp:CheckBox ID="CheckBox1" runat="server" /> </EditItemTemplate> <ItemTemplate> <asp:CheckBox ID="CheckBox1" runat="server" /> </ItemTemplate> </asp:TemplateField> </Columns> <FooterStyle BackColor="#1C5E55" ForeColor="White" Font-Bold="True" /> <HeaderStyle BackColor="#33CC33" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#009900" ForeColor="White" HorizontalAlign="Center" /> <RowStyle BackColor="#E3EAEB" /> <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" /> <SortedAscendingCellStyle BackColor="#F8FAFA" /> <SortedAscendingHeaderStyle BackColor="#246B61" /> <SortedDescendingCellStyle BackColor="#D4DFE1" /> <SortedDescendingHeaderStyle BackColor="#15524A" /> </asp:GridView> <p> </p> <p></p> <asp:Button ID="Button1" runat="server" Text="valider" onclick="Button1_Click" /> <asp:Table ID="Table1" runat="server"> </asp:Table> <asp:Label ID="Label4" runat="server" Text="" Visible ="false"></asp:Label> <asp:Label ID="Label5" runat="server" Text="" Visible="false"></asp:Label> <asp:Label ID="Label6" runat="server" Text="Label" Visible ="false"></asp:Label> <asp:Label ID="Label7" runat="server" Text="Label" Visible ="false"></asp:Label> <asp:Label ID="Label8" runat="server" Text="Label" Visible ="false"></asp:Label> <asp:Label ID="Label9" runat="server" Text="Label" Visible ="false"></asp:Label> <asp:Label ID="Label10" runat="server" Text="Label" Visible ="false"></asp:Label> <asp:Label ID="Label11" runat="server" Text="Label" Visible ="false"></asp:Label> <asp:DropDownList ID="DropDownList4" runat="server" visible ="false" DataSourceID="AccessDataSource4" DataTextField="Niveau_du_besoin" DataValueField="Niveau_du_besoin"> </asp:DropDownList> <asp:AccessDataSource ID="AccessDataSource4" runat="server" DataFile="C:\Users\dell\Downloads\GestionRisquee.mdb" SelectCommand="SELECT [Niveau du besoin] AS Niveau_du_besoin FROM [Confidentialité]"> </asp:AccessDataSource> <asp:DropDownList ID="DropDownList5" runat="server" visible ="false" DataSourceID="AccessDataSource4" DataTextField="Niveau_du_besoin" DataValueField="Niveau_du_besoin"> </asp:DropDownList> <asp:AccessDataSource ID="AccessDataSource5" runat="server" DataFile="C:\Users\dell\Downloads\GestionRisquee.mdb" SelectCommand="SELECT [Niveau du besoin] AS Niveau_du_besoin FROM [Integrité]"> </asp:AccessDataSource> <asp:DropDownList ID="DropDownList10" runat="server" visible ="false" DataSourceID="AccessDataSource10" DataTextField="Niveau_du_besoin" DataValueField="Niveau_du_besoin"> </asp:DropDownList> <asp:AccessDataSource ID="AccessDataSource10" runat="server" DataFile="C:\Users\dell\Downloads\GestionRisquee.mdb" SelectCommand="SELECT [Niveau du besoin] AS Niveau_du_besoin FROM [Disponibilité]"> </asp:AccessDataSource> <asp:DropDownList ID="DropDownList11" runat="server" DataSourceID="AccessDataSource11" DataTextField="consequence" DataValueField="consequence" AutoPostBack="True" onselectedindexchanged="DropDownList11_SelectedIndexChanged" Visible="False"> </asp:DropDownList> <asp:AccessDataSource ID="AccessDataSource11" runat="server" DataFile="C:\Users\dell\Downloads\GestionRisquee.mdb" SelectCommand="SELECT [consequence] FROM [Consequences]"> </asp:AccessDataSource> <asp:TextBox ID="TextBox2" runat="server" Height="74px" TextMode="MultiLine" Width="255px" Visible="False"></asp:TextBox> <asp:DropDownList ID="DropDownList12" runat="server" DataSourceID="AccessDataSource12" DataTextField="Mesure" DataValueField="Mesure" AutoPostBack="True" onselectedindexchanged="DropDownList12_SelectedIndexChanged" Visible="False"> </asp:DropDownList> <asp:AccessDataSource ID="AccessDataSource12" runat="server" DataFile="C:\Users\dell\Downloads\GestionRisquee.mdb" SelectCommand="SELECT [Mesure] FROM [Mesures existants]"> </asp:AccessDataSource> <asp:TextBox ID="TextBox3" runat="server" Height="74px" TextMode="MultiLine" Width="255px" Visible="False" ></asp:TextBox> <asp:DropDownList ID="DropDownList13" runat="server" visible ="false" DataSourceID="AccessDataSource13" DataTextField="Niveau_du_vraisemblance" DataValueField="Niveau_du_vraisemblance"> </asp:DropDownList> <asp:AccessDataSource ID="AccessDataSource13" runat="server" DataFile="C:\Users\dell\Downloads\GestionRisquee.mdb" SelectCommand="SELECT [Niveau du vraisemblance] AS Niveau_du_vraisemblance FROM [Vraisemblance]"> </asp:AccessDataSource> <asp:AccessDataSource ID="AccessDataSource2" runat="server" DataFile="C:\Users\dell\Downloads\GestionRisquee.mdb" SelectCommand="SELECT * FROM [Scenarios]"></asp:AccessDataSource> <asp:Button ID="Button2" runat="server" Text="Calcul Risque" onclick="Button2_Click" /> <asp:Label ID="Label3" runat="server" Text="Label"></asp:Label> <p></p> <asp:DropDownList ID="DropDownList3" runat="server" DataSourceID="AccessDataSource3" DataTextField="Mesure" DataValueField="Mesure" AutoPostBack="True" onselectedindexchanged="DropDownList3_SelectedIndexChanged"> </asp:DropDownList> <asp:AccessDataSource ID="AccessDataSource3" runat="server" DataFile="C:\Users\dell\Downloads\GestionRisquee.mdb" SelectCommand="SELECT [Mesure] FROM [Mesures Reduction]"> </asp:AccessDataSource> <p></p> <asp:TextBox ID="TextBox1" runat="server" Height="74px" TextMode="MultiLine" Width="255px" ></asp:TextBox> </asp:Content>Hope Im clear and sorry for bothering you
Regards
YosrJ
basheerkal
Star
10672 Points
2426 Posts
Re: Data in TableRow are not being read
Apr 10, 2012 02:43 AM|LINK
Will you Please explain very briefly what do you try to do?
You have a GridView. In each row there are many DropDownLists and a CheckBox. And You have a Table out side GridView
Looping thrugh the gridview rows, in each row you loop through all the rows of the table and doing some calculation using value of that row and next row and the selected values of the some of the DropDownLists and assigning values to some variables....
Please complete this......
Also please tell me What is
rowgridview++;
(Talk less..Work more)
Yosr Jemili
Member
2 Points
13 Posts
Re: Data in TableRow are not being read
Apr 10, 2012 09:42 AM|LINK
Hi basheerkal
My page shows a gridview with a checkbox column.
When I select for example 3 rows in gridview i click in a button and a table1 is created dynamically (numbers of checked rows in gridview are number of rows in table1)
After that i select some value of each row in table1 and compare values of each row to calculate a value and affect it to label3
That's it
The error is that like the table1 is empty and loose its values in postback i think
Hope i was clear
Regards
YosrJ