gridview

How to produce sum of each column in sql?

别来无恙 提交于 2019-12-14 03:28:33
问题 i am trying to do column wise addition in Gridview but couldn't. like i am filling gridview from store procedure which gives these values . DateTime 10Quantity 20Quantity 30Quantity 10Amount 20Amount 30Amount GrandTotal 03/10/2015 792 0 594 7920 0 17820 25740 03/10/2015 332 3 194 9990 0 28220 38739 Expected: DateTime 10Quantity 20Quantity 30Quantity 10Amount 20Amount 30Amount GrandTotal 03/10/2015 792 0 594 7920 0 17820 25740 03/10/2015 332 3 194 9990 0 28220 38739 Totals 1124 3 788 17910 0

OnRowCommand=“grd_RowCommand” event not firing when click on row

那年仲夏 提交于 2019-12-14 03:18:40
问题 here i bind grid columns dynamically using code behind because my GetSocailAnalytics method return dynamic column according to parameter passed.after binding column of grid using data table my grd_OnRowCommand event not firing when i click on grid row. grid is successfully bind. can any one help me out this issue.here is my code... <asp:GridView ID="grd" EnableViewState="true" AutoGenerateColumns="false" OnRowCommand="grd_RowCommand" runat="server" OnRowDataBound="grd_RowDataBound"> <Columns>

How to get Text value of Label-controls in cells of GridView?

陌路散爱 提交于 2019-12-14 03:17:25
问题 In my GridView there is a column containing Label-controls as value. I need to know how to access each Label-control to get its Text value. Any help is appreciated. 回答1: You can store its value in a hidden field and place it in any other column. Then when you retrieve that row value you can access that hiddenfield value 回答2: handle selectedIndexChanged event and in it do string text = ((Label)grid.SelectedRow.Cells[cellIndex]).Text; string text = grid.SelectedRow.Cells[0].Text; // this should

Eval/Bind TimeOfDay property without milliseconds?

↘锁芯ラ 提交于 2019-12-14 03:00:26
问题 I'm trying to format the following: <%# Bind("TimeOfDay","{0:HH:mm:ss}") %> <%# Eval("TimeOfDay","{0:HH:mm:ss}") %> <%# Bind("TimeOfDay","{0:HH:mm:ss tt}") %> But using either of those returns time as following: 08:33:08.1430000 How can I only get the 08:33:08 part? Thanks, EtonB. 回答1: ((DateTime)Eval("TimeOfDay")).ToString("HH:mm:ss") ? 来源: https://stackoverflow.com/questions/3970154/eval-bind-timeofday-property-without-milliseconds

display data in gridview

泄露秘密 提交于 2019-12-14 02:07:29
问题 i want to display data in Gridview in a format like in the image. any ideas folks? the datas in table is stored in this way Qsn1 A train running at the speed of 60 km/hr crosses a pole in 9 seconds. What is the length of the train? Option1 150 metres 5 Qsn1 A train running at the speed of 60 km/hr crosses a pole in 9 seconds. What is the length of the train? Option1 152 metres 5 Qsn1 A train running at the speed of 60 km/hr crosses a pole in 9 seconds. What is the length of the train? Option1

Nested scrollview inside gridview place is taking only somepart

谁都会走 提交于 2019-12-14 01:00:25
问题 I have: 1.Coordinator layout 2.appbar layout (child of Coordinator layout) 3.Collapsing toolbar layout (child of app bar) 4.NestedScrollView (child of coordinator) I want to put a grid view inside NestedScrollView so that user can scroll over the entire screen space. My problem is that currently the gridview occupies a small portion of the NestedScrollView and not full space of NestedScrollView and scrolls inside that portion,like in this image: As you can see my gridview height is limited

How can I format a column from a GridView before export to show all numbers in excel?

风流意气都作罢 提交于 2019-12-14 00:28:11
问题 I'm trying to export a GridView to Excel and I have a column with a series of numbers like 1245333325364. When I run the query for the GridView I can see the complete number but when I export to excel all I see is 1.00133E+12 on that column. I know I can have the user change this in excel but not all files are being open after export they just save it straight into a directory. I will really like to change the column's format in the export process rather than having the user do it before they

How to close navigation drawer from an adapter class

久未见 提交于 2019-12-13 23:15:12
问题 I have a custom navigation drawer which contains buttons in gridview...I need to close the navigation drawer from the adapter class...OR is any other ways to close the drawer when i click a button in the gridview. Onclick is working perfectly but the navigation drawer is not closing... This is my adapter class... public class NavMenuGridViewAdapter extends ArrayAdapter<MenuGridItem>{ ArrayList<MenuGridItem> menuList = new ArrayList<>(); Context context; View activityHome; public

Repopulating a dropdown outside an updatepanel

三世轮回 提交于 2019-12-13 22:09:25
问题 Probably this is an ignorance of Async postbacks, so let me lob a softball out there. I have three cascading dropdowns in an updatepanel, using these you can pick your Store->Department->Product. A fourth DDL sits outside the updatepanel, and using this you pick your competitor. Different stores match with different competitors. A gridview (also outside) then displays the join of Store->Department->Product->Competitor Price. This works fine when you first load and if you switch to a different

ASP.NET gridview does not allow me to click on column header texts so I can sort the data

我是研究僧i 提交于 2019-12-13 22:08:03
问题 I'm just trying to allow the user to sort the GridView by any of the columns of it. <asp:GridView ID="gvShows" runat="server" DataKeyNames="dataSource,title" Caption="Show List" AutoGenerateColumns="False" AllowSorting="True" AllowPaging="True" CaptionAlign="Left" OnSorting="gvShows_Sorting" > <RowStyle BorderColor="Black" /> <Columns> <asp:TemplateField HeaderText="Select"> <ItemTemplate> <asp:CheckBox ID="cbSelect" runat="server" AutoPostBack="false"/> </ItemTemplate> </asp:TemplateField>