Multiply Textbox With Gridview Columns?

Jan 15, 2011

I have write this code to create a gridview with 3 columns

DataTable dt = new DataTable();
dt = new DataTable();
dt.Columns.Add("ID", typeof(int)).AutoIncrement = true; [code]....

I would like to add in this code a textbox with the quantity.When i give the quantity i want in another textbox to have the total.

for example 2*1.5=3

How can i do that? My huge problem is that i dont know how to take the values of the 3rd column.The value 1.5 in this example.

View 2 Replies


Similar Messages:

Data Controls :: Multiply Values Of Two Columns Of GridView TextBoxes Using JavaScript And JQuery

May 7, 2015

Multiplication of two columns in gridview and display the result in third column using Javascript

View 1 Replies

Forms Data Controls :: How To Multiply Gridview Rows With Textbox

Jan 15, 2011

I have write this code to create a gridview with 3 columns

DataTable dt = new DataTable();
dt = new DataTable();
dt.Columns.Add("ID", typeof(int)).AutoIncrement = true;
dt.Columns.Add("Name", typeof(string));
dt.Columns.Add("Price(Grouch)/Hectares", typeof(float));
DataColumn[] keys = new DataColumn[2];
keys[0] = dt.Columns["ID"];
dt.PrimaryKey = keys;
dt.Rows.Add("1", "Seaside Location", 1.5);
Session[key] = dt;
return dt;

I would like to add in this code a textbox with the quantity.

When i give the quantity i want in another textbox to have the total.

for example 2*1.5=3

How can i do that?

My huge problem is that i dont know how to take the values of the 3rd column.The value 1.5 in this example.

View 2 Replies

Forms Data Controls :: Multiply Two Columns In A Table?

Feb 17, 2011

I wonder how to muliply two columns in a table and the result is displayed in the blank column and be specified by its row..

View 3 Replies

Forms Data Controls :: View Calculations - Multiply 2 Columns And Display Rate

Jan 17, 2011

I have a FormView Bound to an SQL data source. In the DATA there are 2 columns that i would like to multiply together and display there rate

<asp:TextBox ID="txtPeople" runat="server" Text='<%#&nbsp;Bind("People")&nbsp;%>'></asp:TextBox><asp:TextBox ID="txtRate" runat="server" Text='<%#&nbsp;Bind("Rate")&nbsp;%>'></asp:TextBox><asp:TextBox ID="txtTotal" runat="server" Text='<%#&nbsp;Bind("Rate * People")&nbsp;%>'></asp:TextBox>

This is just an example above but i believe it shows what i am trying to do, there is no calculated column in the database so i can not bind to that directly, and i can not just add the column to the data as its not in my permissions. So how do "Bind" the value of two columns multiplied together to a third text box?

View 3 Replies

Web Forms :: How To Multiply 2 Textbox Values

Feb 2, 2011

I want to multiply two textbox values and result should be displayed in another textbox

txtoqt*txtqty=txtqtyreq

should not be keypress event because both values(txtOQty and txtQty) are retreving from database.

View 8 Replies

Multiply Different Selected Checkboxes Text Into Textbox?

Nov 13, 2010

If i have 55 checkboxes with different text 1,2,3,4 and so on ....and a textbox where it display how many no. of checkboxes checked i want to multiply the multiple selected checkbox text with how many checkboxes are checked in other textbox i want to do this using vb.net,asp.net

View 1 Replies

Web Forms :: Multiply Values From Dropdownlist And Textbox?

Jan 29, 2010

I have a dropdownlist which display the price of products which is retrive from database, how do i mulitply if the user entered the quantity in the textbox. I keep getting error input string was not in a correct format.

Here is my aspx code:

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Order.aspx.cs" Inherits="Order" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">[code]......

View 1 Replies

Data Controls :: How To Multiply Two Column Values In GridView

May 7, 2015

How To Multiply TwO  Values In GridView In asp.net using c#

View 1 Replies

Forms Data Controls :: How To Make Number Of Editable Columns Of Gridview Depends On A Textbox Value

Oct 4, 2010

I have a Gridview with 12 columns, Jan, Feb...Dec.

I have a textbox value that could be 1, 2,...12

I want if textbox value is 7, then column Aug-Dec in Gridview is editable when in update mode and the column in Jan-Jul is not updatable (eg make it label instead of textbox).

How can I do this ?

View 3 Replies

Forms Data Controls :: Calculation On Textbox In Gridview Row - Display Total Of All Three Columns In Total Column?

Apr 7, 2010

i have one grid which have 5 columns 1 for subject,2,3,4 for marks which have textbox to insert obtained marks,and last column have one lable to display total of (2+3+4),now i want total value on textbox event,when user enter any value to any column of textbox i need to display total of all three columns in total column.

View 2 Replies

Forms Data Controls :: How To Filter Gridview Columns Data Based On Textbox Event Onkeyup

Feb 9, 2011

how i can filter gridview coloumns data based on textbox event ONKEYUP....

View 15 Replies

Forms Data Controls :: Prevent Displaying " " On The Textbox Control If The GridView Columns Is Null?

Apr 7, 2010

How to prevent displaying this " " on the textbox control if the GridView columns is Null?

View 2 Replies

C# - GridView - Columns.Insert() Cause Data To Vanish On Postback But Columns.Add() Works OK?

Oct 13, 2010

I have a GridView that has several dynamic columns (I do not know how many at design time and it could be 0-12 columns, hence need for dynamic columns). I have the columns in the grid and data bound to them - works great. There are other standard, design-time TemplateField columns with TextBox controls in them. These are bound with values that the user can edit. The grid is posted back via a Submit button. My question is "Why does gv.Columns.Insert() cause all my TextBox data to be null on Postback, but gv.Columns.Add() works like a champ?"

protected void BuildColumns()
{
// The first column to begin to insert the columns in the GridView
int columnIndex = 5;
BoundField aoColumn = new BoundField();
aoColumn.HeaderText = "New Column 1";
gvMyGrid.Columns.Insert(columnIndex, aoColumn); // kills txtQuantity.Text on postback
gvMyGrid.Columns.Add(aoColumn); // works fine
columnIndex++;
foreach (MyEntity my in _myEntityCollection)
{
BoundField myColumn = new BoundField();
myColumn.HeaderText = String.Format("{0:d}", my.StartDate);
gvMyGrid.Columns.Insert(columnIndex, myColumn);
columnIndex++;
}
}

I then go on to assign values to these BoundFields in the _RowDataBound method and all of this works great. However, when I post back and try to reference some TextBox and they are all null. And yes, I have the BuildColumns() call wrapped in if (!IsPostBack) on Page_Load. Of course I would like to use .Insert() so that the columns can go in the proper location and not at the end of the Columns array.

View 1 Replies

Forms Data Controls :: In Page User Able To Select Gridview Columns And It Will Hide Remaining Columns

Mar 18, 2010

in asp.net page user able to select gridview Columns, and it will hide remaining columns and that selection done by check box with column list bellow is Image link , what exactly I am looking for [URL] it look bellow after selection of column done [URL]

View 1 Replies

Hide Columns In GridView With Auto - Generated Columns?

Jan 19, 2010

GridView1.Columns.Count is always zero even SqlDataSource1.DataBind();

But Grid is ok I can do

for (int i = 0; i < GridView1.HeaderRow.Cells.Count;i++)

I rename request headers here but

GridView1.Columns[i].Visible = false;

I can't use it because of GridView1.Columns.Count is 0. So how can I hide them ?

View 5 Replies

Show Several Columns In Datasource As Autogenerate Columns In Gridview?

Jan 27, 2011

I have a datasource, which includes many columns, idealy, I need use a gridview to show:

1) first 3 columns: template fields, these fields depends on values in some columns of datasource. I use template fields, hard coded. works fine.

2) the other columns. This is I do not know how to do it. In the data source, there are about 10-20 columns data, each time, the # of columns of the data varies. idealy, I need show each of them as a seperated column in gridview. The entire data source may have 30 columns, but some of them are used in 1), and I only want show these 10-20 columns in gridview. Some columns in data source, I may not use them at all. is there a way to do this? or have to seperate them as a detail view style UI?

View 1 Replies

C# - Display GridView With Many Columns As Two Sets Of Columns?

Jan 20, 2010

I apologize for the odd title. I've been trying to figure out how to do this and can't quite put it into words. Basically, I need to try to display a GridView with a whole bunch of columns (37 in one case) in two "rows" of columns. More or less.

So instead of this:

Column1 Column2 Column3 Column4 Column5 Column6
Data Data Data Data Data Data
Data Data Data Data Data Data
Data Data Data Data Data Data

I'd like something like this:

Column1 Column2 Column3
Data Data Data
Data Data Data
Data Data Data

Column4 Column5 Column6
Data Data Data
Data Data Data
Data Data Data

As in the example there can be multiple rows returned which all need to be displayed. I'm trying to stop a very large horizontal scroll bar being required. I've been searching as much as I can but haven't found anything that fits what I'm looking for.

View 1 Replies

Can't Multiply Int By Int And Get A Decimal (0,00)?

Sep 30, 2010

I have two int in my applicantion and I want multiply and share by 100. This number can be like 7,5 but my decimal result member always save just 7.how can I deal with this question?

Ex.:
decimal result = 0;
decimal a = 15;
decimal b = 50;
result = (a*b)/100;

View 5 Replies

Crystal Reports :: How To Multiply Split Value

Dec 15, 2010

I have The following structure in my crystal report

Qty Rate
5 2,4,6
10 1,5,20

I need like this in my crystal report

Qty Rate Amount Total
5 2,4,6 10,20,30 60
10 1,5,20 10,50,200 260

View 2 Replies

C# - How To Multiply Text Box Values With Javascript

Aug 20, 2010

I would like to multiply the values from two text boxes (txtBox1 should contain an Integer value, txtBox2 should contain a Float value) and place the result in a third text box. My code is below, but it doesn't work. The javascript function is called, otherwise it fails.

[Code]....

View 2 Replies

Forms Data Controls :: How To Convert Gridview Rows To Columns And Columns To Rows

Mar 4, 2011

I'm binding a gridview from a webservice with 30 columns and 10 rows, I need to print the same in a PORTRAIT, for that i decided to display columns as rows and

rows as columns like below:

EMP1 1 2 3 4
EMP2 1 2 3 4

View 3 Replies

How To Pull Values From A QueryString / Add/Multiply Them And Then Write To A Label

May 5, 2010

I'm at the end of a project and have hit a wall. I'm pretty unfamiliar with VB so this is why I've left this piece of the project for last.

I have a popup window in which I pass some values via QueryString. I want to be able to pull them into my application and do some math on them and then write them out to my aspx page. The problem is I don't know where/how to begin. I've searched around the asp.net boards, but can't seem to find any good starting point.

I'm reading in some dollar amounts, a percentage and an Id that I'll use to pull a payment schedule (number of payments). I'm trying to get at a payment breakdown. I was thinking of writing it Something like this:

[Code]....

View 3 Replies

Mobiles :: Set No Of Rows & Columns For Textbox?

Apr 26, 2010

how i will set No Of Rows & Columns for textbox in Mobile web controls.

View 2 Replies

Forms Data Controls :: Sum Columns (sql) And Show It In Textbox?

Sep 22, 2010

i have 50 columns and i want to show the total of each column(total of rows in this column) into 1 textbox that mean they show in 20 textbox

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved