How wiew result from dataGrid( sum of one collumn and get it in one textBox)
-example: sum of xlx Column and i will this sum show in a textBOX
How wiew result from dataGrid( sum of one collumn and get it in one textBox)
-example: sum of xlx Column and i will this sum show in a textBOX
Wiew(get) result in text.Box from DataGridWiew
Kinnos
DataSet dataSet = (DataGrid)grid.DataSource;
DataTable table = dataSet[ grid.DataMember ];
double total = 0;
foreach( DataRow row in table.Rows )
{
total += Convert.ToDouble( row[ "MyColumnToCount" ] );
}
txtTotal.Text = total.ToString();
mehim
bowie
SoCalChris
So, please try to solve this on the board first.
JackBriggs
reportman
Thanks in advance!
Oopier
Screenshot to indicate the problem
What do you want to enable in this Textbox
You want users to type a Sum-expression there and your application will calculate this or do you want to display the total of all Iznos Rab. in the TextBox
SamProsser
public void PrikaziRabat(int RedniBroj)
{
decimal SumaRabata = 0;
foreach (DataRow row in ulazRobeDataSet1.UlazArtikala)
{
if ((int)row["RedniBroj"] == RedniBroj)
{
SumaRabata += Convert.ToDecimal(row["IznosRabata"]);
}
}
iznosRabataTextBox.Text = SumaRabata.ToString();
}
call method
PrikaziRabat(int.Parse(brojRacunaTextBox.Text));
ghostsoft
thanks YOU PJ vdS :) again
Steve10
sorry for my bad english :)
can i send picture of my problem on your mail
poskokpos@hotmail.com - my mail
Stevey
I don't really understand your question.