问题描述:

i am using gridview inside listview on listview_itembound event im getting records as per requirement bt the prbm is this that im having footer in my gridview where i have to show some record bt data is not visible in my grid please help me by telling were im wrong follow is my code:

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);

}

}

网友答案:

I am assuming you're trying to add some summary on the footer, to display it you should add something like this depending on which column you need to display it:

e.Row.Cells[i].Text = "Total: " + GetYourValue();
相关阅读:
Top