I am working to loop thouh my Accordion and group the Totals in each pane.
To Achieve this I am trying to group the ClientIds and storing in a List<string>
Please could you help with adding totals to each of my Accordion's panes.
[CODE]
protected List<string> GrpKeyClientIds = new List<string>();
protected List<string> GrpQuantityClientIds = new List<string>();
Dictionary<string, string> mydictionary = new Dictionary<string, string>();
ArrayList myArray = new ArrayList();
protected void accOnItemDataBound(Object sender, AjaxControlToolkit.AccordionItemEventArgs e)
{
if (e.AccordionItem.ItemType == AjaxControlToolkit.AccordionItemType.Header)
{
Label lblGrpKey = e.AccordionItem.FindControl("lblGrpkey") as Label;
if (lblGrpKey != null) GrpKeyClientIds.Add(lblGrpKey.ClientID);
if (GrpQuantityClientIds != null)
{
myArray.Add(GrpQuantityClientIds);
}
}
}
protected void lvOnItemDataBound(Object sender, ListViewItemEventArgs e)
{
TextBox txtQuantity = e.Item.FindControl("txtQuantity") as TextBox;
if (txtQuantity != null) QuantityClientIds.Add(txtQuantity.ClientID);
mydictionary.Add(e.Item.ClientID, txtQuantity.ClientID);
for(int i = 0; i< GrpKeyClientIds.Count ; i++)
{
if(GrpKeyClientIds[i].Contains("MyAccordion_Pane_" + i) == e.Item.ClientID.Contains("MyAccordion_Pane_" + i))
{
if (txtQuantity != null) GrpQuantityClientIds.Add(txtQuantity.ClientID);
}
}
}
[/CODE]
thanks