0

我在listview_itembound事件的listview中使用gridview我根据要求获取记录bt prbm是我在我的gridview中有页脚我必须显示一些记录bt数据在我的网格中不可见请帮助我告诉我我错了以下是我的代码:

protected void ListView1_ItemDataBound(object sender, ListViewItemEventArgs e)
{
    if (e.Item.ItemType == ListViewItemType.DataItem)
    {
        ListViewDataItem item = (ListViewDataItem)e.Item;
        GridView grdview = (GridView)item.FindControl("GridView1");
        Label lblenqid = (Label)item.FindControl("Label2");
        Label lblclientname = (Label)item.FindControl("Label3");
        //string enquiryid = lblenqid.Text;
        DateTime ArrivesOn = DateTime.Parse(txtstartdate.Text);
        //GridView grdvw = (GridView)ListView1.FindControl("GridView1") as GridView;
        objHotel.Tour_Detail(grdview, ArrivesOn,lblclientname.Text,lblenqid.Text);
        //objHotel.Tour_DetailVehiclePackageCost(grdview, lblenqid.Text);
    }
}

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.Footer)
    {
        GridView grdview1 = (GridView)e.Row.FindControl("GridView1");
        Label lblenqid = (Label)e.Row.FindControl("lblenqid1");
        Label lblname = (Label)e.Row.FindControl("lblname");
        DateTime ArrivesOn = DateTime.Parse(txtstartdate.Text);

        objHotel.Tour_Detail(grdview1, ArrivesOn, lblname.Text, lblenqid.Text);
        //objHotel.Tour_DetailVehiclePackageCost(grdview1, lblenqid.Text);
    }
}
4

1 回答 1

0

我假设您正在尝试在页脚上添加一些摘要,要显示它,您应该根据需要显示的列添加类似的内容:

e.Row.Cells[i].Text = "Total: " + GetYourValue();
于 2013-10-08T12:47:35.577 回答