So, I have a GridView to input parameters to block productions. I have 2 CheckBox, one at the beginning (which runs ok) and a second one at the end.
<asp:TemplateField HeaderText="Taxativo">
<ItemTemplate>
<asp:CheckBox ID="CBTax" runat="server" />
</ItemTemplate>
<FooterStyle HorizontalAlign="Right" />
<FooterTemplate>
<asp:Button ID="ButtonAdd" runat="server" Text="Agregar linea" OnClick="ButtonAdd_Click" />
</FooterTemplate>
</asp:TemplateField>
It has a footer that has a button that add rows to the grid.
So, when you save, it makes a text file where it has all the inputs the user added, so when you access again you can see the last exceptions made for the productions. Code is:
CheckBox CBTax = (CheckBox)BloqLinea.Rows[rowIndex].Cells[10].FindControl("CBTax");
bool flag;
if(Boolean.TryParse(parts[9].ToString(), out flag2)){
CBTax.Checked = flag;}
else{
CBTax.Checked = false;}
My problem is that any other TextBox, DropDownList and CheckBox previous this one loads the string(or converts it in parse for the CheckBox), except this one. Any suggestions for what to check or what the error may be??
EDIT - Also, the text file has lines like this:
False,Restringe Anchos Rev ME por el MC2,IREP4901,,ang,,Expo,CGL_PSQ,110.21,True
So the column for the checkbox CBTax is at the end.
Aucun commentaire:
Enregistrer un commentaire