Tuesday, 29 October 2013

grid row having button and after click particulare row button event find entire grid checkbox selected rows only using linq list

     
  List<int> listIndex = CheckedRows.AsEnumerable().Select(f => f.RowIndex).ToList();

            foreach (int rowIndex in listIndex)
            {
                TextBox txtExpenseAccount = (TextBox)grvVendorProperties.Rows[rowIndex].FindControl("txtExpenseAccount");
                TextBox txtInitialBalance = (TextBox)grvVendorProperties.Rows[rowIndex].FindControl("txtInitialBalance");
                Button btnExpenseAccount = (Button)grvVendorProperties.Rows[rowIndex].FindControl("btnExpenseAccount");
                TextBox txtEffectiveDate = (TextBox)grvVendorProperties.Rows[rowIndex].FindControl("txtEffectiveDate");
                TextBox txtReceiptAccount = (TextBox)grvVendorProperties.Rows[rowIndex].FindControl("txtReceiptAccount");
                Button btnReceiptAccount = (Button)grvVendorProperties.Rows[rowIndex].FindControl("btnReceiptAccount");

                txtExpenseAccount.Enabled = true;
                txtInitialBalance.Enabled = true;
                btnExpenseAccount.Enabled = true;
                txtEffectiveDate.Enabled = true;
                txtReceiptAccount.Enabled = true;
                btnReceiptAccount.Enabled = true;

            }




No comments:

Post a Comment