This is a migrated thread and some comments may be shown as answers.

can i set value for footer in item cammand?

1 Answer 63 Views
Grid
This is a migrated thread and some comments may be shown as answers.
niloofar
Top achievements
Rank 1
niloofar asked on 29 Jan 2011, 09:13 AM
hi
i write this code in itemcommandi have error
please help

  GridFooterItem footer = (GridFooterItem)e.Item;

                                CDS.Savin.WebUI.Generals.General.SumDiscount = sumDicount;
                                CDS.Savin.WebUI.Generals.General.SumPrice = SumTotalPrice;
                                (footer["Count"].FindControl("txtSumCount") as TextBox).Text = (CDS.Savin.WebUI.Generals.General.numberToMoney(SumCount.ToString()));
                                (footer["Price"].FindControl("txtSumPrice") as TextBox).Text = (CDS.Savin.WebUI.Generals.General.numberToMoney(sumprice1.ToString()));
                                (footer["Discount"].FindControl("txtSumDiscount") as TextBox).Text = (CDS.Savin.WebUI.Generals.General.numberToMoney(sumDicount.ToString()));
                                (footer["totalPrice"].FindControl("txtSumTotalPrice") as TextBox).Text = (CDS.Savin.WebUI.Generals.General.numberToMoney(SumTotalPrice.ToString()));
                                (footer["sumprice"].FindControl("txtSumPriceT") as TextBox).Text = ((SummPrice.ToString()));

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 31 Jan 2011, 10:14 AM
Hello Niloofar,

Give a try with the following code snippet to set footer value in ItemCommand event.

C#:
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
    {
       if(e.CommandName=="commandname")//your commandNmae
        {
        GridFooterItem footer = (GridFooterItem)RadGrid1.MasterTableView.GetItems(GridItemType.Footer)[0];
        (footer["Count"].FindControl("txtSumCount") as TextBox).Text = "xx";//set your value
        }
    }

Thanks,
Princy.
Tags
Grid
Asked by
niloofar
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or