in mobile responsive gridview header text is coming in footer,i done my project in three tire-----iam geeting header text of slot type ,no of dates ,unit price etc like below
and here unit price is the total of no slots total he booked and grand total is total of all slots
:
No of Dates :
SlotType : Grand Total
Unit Price : 32,000.00
my grird.....
| Add Id | Selected Dates | No of Dates | SlotType | Unit Price | |
|---|---|---|---|---|---|
| Select | |||||
| Select | |||||
| Select | |||||
| Select | |||||
| Select | |||||
| Select | |||||
| Select | |||||
| Select | |||||
| Select | |||||
| Select | |||||
| Select | |||||
| Select | |||||
| Grand Total | 32,000.00 | ||||
mobile grid like this.....
| Add Id | Selected Dates |
|---|---|
: No of Dates : SlotType : Grand Total-----------------------this is my problem area Unit Price : 32,000.00 please send soluton as posssible | |
this is my grid
-----------------
CellPadding="4" GridLines="None" OnRowDataBound="GridTotal_RowDataBound"
OnRowEditing="GridTotal_RowEditing" OnSelectedIndexChanged="GridTotal_SelectedIndexChanged" ShowFooter="True" OnPageIndexChanging="GridTotal_PageIndexChanging" ForeColor="#333333" Style="max-width: 1000px">
<%--
<%#Container.DataItemIndex+1 %>
--%>
<%#Eval("AdvtPostingDates","{0:DD/MM/YYYY}") %>
<%#Eval("TotalPostingDays") %>
<%#Eval("SlotType") %>
<%--
--%>
<%#Eval("TotalPrice") %>
<%--
$(function () {
$('[id*=GridTotal]').footable();
});
rel="stylesheet" type="text/css" />
And .cs code is of bindgrid
private void BindGrid()
{
dbo.AdvertiserId = Convert.ToInt32(Session["AId"]);
dt = bl.AdvertiserTotalPrice(dbo);
//foreach(DataRow orow in dt.Rows)
GridTotal.DataSource = dt;
GridTotal.DataBind();
//code here.
if (GridTotal.PageCount != 0)
{
GridTotal.HeaderRow.Cells[0].Attributes["data-hide"] = "phone";
GridTotal.HeaderRow.Cells[1].Attributes["data-class"] = "expand";
//Attribute to hide column in Phone.
//GridTotal.HeaderRow.Cells[2].Attributes["data-hide"] = "phone";
GridTotal.HeaderRow.Cells[3].Attributes["data-hide"] = "phone";
GridTotal.HeaderRow.Cells[4].Attributes["data-hide"] = "phone";
GridTotal.HeaderRow.Cells[5].Attributes["data-hide"] = "phone";
//GridTotal.HeaderRow.Cells[5].Attributes["data-class"] = "expand";
GridTotal.HeaderRow.TableSection = TableRowSection.TableHeader;
decimal total = dt.AsEnumerable().Sum(row => row.Field("TotalPrice"));
GridTotal.FooterRow.Cells[4].Text = "Grand Total";
GridTotal.FooterRow.Cells[4].HorizontalAlign = HorizontalAlign.Right;
GridTotal.FooterRow.Cells[5].Text = total.ToString("N2");
}
Replies
Know the answer? Post it — somebody with the same question will find it here.