Forms Data Controls :: Compute In Gridview
Mar 17, 2011I have a question, I have a Gridview with the field Description, quantity, Price per Unit, How can I compute (Quantity)*(Price per Unit ) = () on the gridview?
View 4 RepliesI have a question, I have a Gridview with the field Description, quantity, Price per Unit, How can I compute (Quantity)*(Price per Unit ) = () on the gridview?
View 4 RepliesI am having an requirement of displaying the records in the following way in the gridview.
Division
Region
Amount
North
Region1
123
North
Region2
124
North
Total
247
South
Region1
123.......
i have a column named POINT.. it is the point in every question... therefore i want to get the total of this column..
View 3 RepliesHere's what I am trying to do:
Inside Form View Want to display the average of a field based from field1/field2
ie:)
Field 1 = 10
Field 2 = 5
Field 3 would equal 2 (Field 1 / Field 2)
How would I go abaout doing this. Code currently looks like:
[Code]....
Using custom bind expression in the formview but it won't let me do this..
I am working on an auto trade website. On the page where Ad list gets displayed, I plan to display the number of Ad for different categories: for example, for location: I will display something like "Vancouver (50), Richmond (12), Surrey (20)". For vehicle make, the following will be shown "Honda (20), Ford(12), VW (24)".
I am not sure if I should pull ALL the ad from the db into a List first, bind one page of the result to gridview control, and then compute stats for each category using Linq. if course I will limit the number of rows pulled from the db using some kind of condition - maybe set the MAX # of rows to be returned as 500.
My major concern is - is this going to be a memory hog?
I have a problem with my asp.net program. I am doing a Datatable.compute on a very large database with a like condition in it. The result takes something like 4 minutes to show or does a Request timeout. If I do the same request with a = and a fix text, it takes nearly 1 minute to show, which for my use is acceptable.
Here is the line that is so slow:
float test = (int)Datatbl.Tables["test"].Compute("COUNT(pn)", "pn like '9800%' and mois=" + i + " and annee=" + j);
I have a repeater that display a customer's bill. Now, the customer has the option to select which of the account he/she will pay. Therefore, in my interface, I have a checkbox in my repeater. All I wanted is to compute for the total amount to pay based on the selected checkboxes. Below is my code for my repeater under ItemTemplate.
Code:
<ItemTemplate>
<tr>
<td style="border: 1px solid #000;">
<asp:CheckBox ID="chkEntryCode" Text='<%# DataBinder.Eval(Container.DataItem, "Code") %>' runat="server" />
</td>
<td style="border: 1px solid #000;">
<asp:Label ID="lblRequestID" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "requestid") %>'></asp:Label>
</td>
<td style="border: 1px solid #000;"><%# DataBinder.Eval(Container.DataItem, "Description") %></td>
<td style="border: 1px solid #000;">
<asp:Label ID="lblAmount" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Amount") %>'></asp:Label>
</td>
</tr>
</ItemTemplate>
And for me to compute for the amount to pay based on the checked checkboxes. I have the following code.
Code:
protected void rBill_ItemCommand(object source, RepeaterCommandEventArgs e)
{
double dAmountToPay = 0;
for (int i = 0; i <= rBill.Items.Count - 1; i++)
{
CheckBox chkItem = (CheckBox)rBill.Items[i].FindControl("chkEntryCode");
Label lblAmount = (Label)rBill.Items[i].FindControl("lblAmount");
if (chkItem.Checked)
dAmountToPay = dAmountToPay + double.Parse(lblAmount.Text);
}
lblTotalAmount.Text = dAmountToPay.ToString();
}
Well, based from the code I provided, there's nothing happens at all.
I am doing some aggregates on in memory tables using the DataTable.Compute method. It works file if there is only one filter, however when there is multiples then it does not work.
This first one works fine the second one does not.
[Code]....
I have a webservice which retrieves data from another external service. The data is already in JSON Format. So I retrieve it and set it to the return value (type: string) of my webservice. But according to firebug the webservice then encapsulates the provided JSON-Data with a backslash, e.g. it returns:
[Code]....
instead of
[Code]....
But the JSON provided by the external service is correct. So how could I provide the correct string to jTemplate from my Webservice?
I have two gridviews, say 'A' and 'B'...I want to add all the rows of 'A' to 'B' while avoiding the duplicates....For eg:
View 10 RepliesIn nested gridview, i am finding some problem, i want to show child Grid headers in Parent Gridview. Can anyone tell me that how it is possible? Its very urgent. Waiting for quick response.
View 1 Replies I am unable to access the data in the gridview's selected row. I have done this lots of times but must be forgetting something.
Here is my gridview:
[Code]....
[Code]....
[Code]....
I have a dropdownlist outside the gridview control. My griview control also have dropdownlist in the first column. I want to populate the dropdownlist inside the gridview control for all rows when the selected item is changed in the outside dropdownlist.
View 2 RepliesI have a customized gridvew i.e. grvResult. There is a textbox and a InsertButton in the footer.
If there is a data populated into gridview it is showing GridView footer and inserting data but if there is no data in gridview then its footer also not visible.
I have tried in two ways to make footer visible but it is showing following error:
Object reference not set to an instance of an object.
Tried ways:
[Code]....
[Code]....
I was wondering if it is possible to add additional data to Excel document created from gridview. What I want to do is to manually add data to certain rows and columns (date, couple of titles, etc), but I'm not sure how to do it.
Currently I'm using the following code:
[Code]....
iam using asp.net with c#, my grid contains 1st column is check box ,and paging is true ,iam displaying data from view that does not contain primary key, so based on this when user selects the no of checkboxes in 1st page and in another page some records then i want to transfer to another page gridview but it is not displaying. can you correct my code where iam going wrong
string constr = "Data Source=MAINSERVER;Initial Catalog=Inventory;User ID=sa;Password=nsg";
protected void Page_Load(object sender, EventArgs e)
{
[code]...
how to implement Insert feature to a grid view?I need to use fields with scroll bar inside of a grid view. Is that possible through the template field?
View 23 RepliesHow to populate dropdownlist in a gridview by selecting another dropdown in same gridview
i tried the code in driiopdownlist selectedchanged
dropdownlist d=(dropdownlist)gridview.findcontrol("dropdownlist1") but it gives null
Using vb.net/asp.net 2005.I have an inner gridview.The outer gridview is "Authors" and in the inner gridview (GridView1 below) I have to set it up so that the user cannot delete the last book from the inner grid, if they try to delete the last book from that inner grid then I want to show the exception message below.
So I am checking the GridViewRows1.Rows.Count which works great when I have one record (one book) to start with. The problem is when I have 2 books (for example). I am writing out the test statement below and the RowCount is always 2 each time, never decremented, even after I rebind.Editing this now: i realize that my initial logic is faulty because when I rebind my inner gridview I am not specifying which inner gridview so the result is that only the last inner gridview is being re-bound, so I think that I need to get the selected inner gridview and then refresh that...
[Code]....
I had a problem with my site in the past couple days and have almost recovered, but now I'm stuck on some code that has an Auto-Complete feature, which allows a user to type a name of a pub into a TetxBox, and based on the returned names, the user can click one and see that name in the GridView (just below the TextBox). The GridView was set up so that there was an href that the user could click on and that would open a window and the user would see the pub in Google Maps. The code below works just fine for the Auto-Complete and the GridView.
[Code]....
Here is the end of the working code. Somehow I need to use the code below to make
the GridView have a href to allow a user to click and see the pub in Google
Maps:
[Code]....
The code above worked fine before, but I'm not sure how it was incorporated into the GridView, and since I had a problem with my site a few days ago, I haven't been able to figure out this part.I'd sincerely appreciate any help in getting this up and running again.
I currently have a gridview that has 1 column with radiobuttons. I then have a update button to update all the selected records. But what i want to do is add a step before the update. I want to add a multi-line textbox for each radiobutton selected to allow them to add notes/comments for each record before the update occurs.
Because the textbox will be large to allow them to enter the comments, i wanted to list them out seperately per record selected. Maybe a gridview is not what i need for the 2nd part, but thats the scenario and looking for suggestions on what / how to do it.
Example:
GRIDVIEW1
ID column1 column2 column3 radiocolumn
1 1111 2222 3333 Yes / No (selected Yes)
2 2222 3333 4444 Yes / No
GRIDVIEW2
ID NotesColumn
1 Texbox displays here
If the gridview binds to empty dataset, I need to still show a gridview so that users can ADD more using the textfields in the bottom of the footer template. Since the gridview is empty it won't bind not allowing rendering of the <footer template> I guess I should create a empty dataset if the gridview is empty. How do I check for this and can this be done in GridviewRowEventArgs
View 5 Repliesi am using Grid view. when ever bulk data is there in Gridview, Header and footer must not be move..
how can i do that.
I have a parent gridview which has a child gridview in the itemsTemplate. Both are binded to different SqlDataSources. I can successfully update and delete rows in the child gridview. After updating in the child gridview, some related data in the parent gridview are not updated automatically. So i have placed ParentGridview.Databind() in the rowupdated event of child gridview. But it doesnt look working.
How can i accomplish this?
I have nested 2gridview. I want to access textbox in second gridview footertemplate. How can I do this.My code is
[Code]....
Code Behind
[Code]....
Iwrite this code but I get
Object reference not set to an instance of an object.