在列表视图中的gridview的页脚中看不到记录

时间:2013-10-08 12:02:30

标签: c# asp.net

我在listview_itembound事件中使用gridview里面的listview按照要求获取记录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);
    }
}

1 个答案:

答案 0 :(得分:0)

我假设你试图在页脚上添加一些摘要,为了显示它你应该添加这样的东西,具体取决于你需要显示它的列:

e.Row.Cells[i].Text = "Total: " + GetYourValue();