cartel Posted March 20, 2018 Share Posted March 20, 2018 Devexpressde hesaplama işlemi Merhaba , grid üzerinde borç ,alacak diye iki adet kolonum var bunların yanına yuruyen bakiye yapmak istiyorum örnek: borc alacak bakiye 100 0 100 200 0 300 0 50 250 gibi sqlden işlem yapmadan grid üzerinde bu işlem nasıl sağlarım. Quote Link to comment Share on other sites More sharing options...
korasoglu Posted April 3, 2018 Share Posted April 3, 2018 Sevgili cartel veriyi veri tabanındanmı alıyorsun belli değil eğer oradan alıyorsan datatable yükle daha sonra tabloyu döngü içerinde hesaplatıp gridControl1.DataSource yap yada örnek paylaş görelimki yardımcı olabilelim. Quote Link to comment Share on other sites More sharing options...
KintaRo Posted April 11, 2018 Share Posted April 11, 2018 eğer grid'e datasource'u gösterdikten sonra bunu yapmak istiyorsanız şu şekilde olur: decimal bakiye = 0; for (int i = 0; i < view.RowCount; i++) { decimal borc = Convert.ToDecimal(view.GetRowCellDisplayText(i, view.Columns[1])); decimal alacak = Convert.ToDecimal(view.GetRowCellDisplayText(i, view.Columns[2])); bakiye += borc - alacak; view.SetRowCellValue(i, view.Columns[3], bakiye.ToString("N2")); } ama ben önce veriyi bir datatable'da tutup sonra bakiye sütunu olan bir datatable'a aktarıyorum ve sonra grid'e gösteriyorum. size kalmış. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.