Jump to content

Devexpressde Hesaplama Işlemi


cartel
 Share

Recommended Posts

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.

Link to comment
Share on other sites

  • 2 hafta sonra ...

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ış.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...