User Profile

Collapse

Profile Sidebar

Collapse
Yangkyu Lee
Yangkyu Lee
Last Activity: Jul 22 '12, 02:24 AM
Joined: Jan 10 '12
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Yangkyu Lee
    replied to sum filtered rows in datagridview (C#)
    Thanks but!

    Thank you very much for your help!!! I really appreciate.
    But the problem is that DataGridView is binded to database source, so when I tried your method an error has occurred.
    Here is the code calling the method:

    dataAdapter = new SqlDataAdapter( cmd);
    try
    {
    BindingSource bindingSource = new BindingSource() ;
    objConnection.O pen();
    dataAdapter.Fil l(table);...
    See more | Go to post

    Leave a comment:


  • Yangkyu Lee
    started a topic sum filtered rows in datagridview (C#)

    sum filtered rows in datagridview (C#)

    I am struggling with the problem of summing filtered rows of datagridview. I can sum the whole datatable with the following program. But I want to summarize only filtered rows of datatable. How can I do that?

    Code:
    private void sumRows(DataTable table)
    {
      DataRow row = table.NewRow();
      for (int i = 1; i < table.Columns.Count; i++)
      {
         row[i] = 0;
      }
      table.Rows.InsertAt(row, 0);
    ...
    See more | Go to post
    Last edited by Stewart Ross; Jan 10 '12, 01:32 PM. Reason: Added code tags
No activity results to display
Show More
Working...