can anybody suggest a grid control ??

  • Thread starter Thread starter Aussie Rules
  • Start date Start date
A

Aussie Rules

Hi,

I am looking for a grid (winform) that I can use in my application that can
do the following...

Cell Calculation.. Like excel does (=sum(cell1 + cell2)) and other basic
calculations

Total Rows - Self calculating total rows (col and row locations). This would
work for when the grid is bound or unbound

Save/export to excel.

Save/load from a access or SQL database.

Thanks
 
Aussie Rules said:
Hi,

I am looking for a grid (winform) that I can use in my application that
can do the following...

Cell Calculation.. Like excel does (=sum(cell1 + cell2)) and other basic
calculations

Total Rows - Self calculating total rows (col and row locations). This
would work for when the grid is bound or unbound

Save/export to excel.

Save/load from a access or SQL database.

I used the Farpoint Spreadsheet VB 6 COM component back in 1999-2000 on very
complicated accounting solutions. Hopefully, they still have a trial ware
full featured .Net component like they had for VB 6 that you can try. Or you
could InterOp the COM solution into .Net.

Http://www.fpoint.com/
 
Hi Aussie,

If you're using VS2005, I suggest you use DataGridView control in your
project to get what you want. DataGridView is newly introduced in .NET 2.0
and is easy to extend.
Cell Calculation.. Like excel does (=sum(cell1 + cell2)) and other basic
calculations

You could handle the DataGridView's CellFormatting and CellValueChanged
events to do this. The following is a sample, in which the DataGridView has
3 rows and 3 columns and the value in the 3rd column has is the sum of the
2nd and first columns.

Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Me.DataGridView1.RowCount = 3
Me.DataGridView1.ColumnCount = 3
End Sub

Private Sub DataGridView1_CellFormatting(ByVal sender As Object, ByVal
e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles
DataGridView1.CellFormatting
If (e.RowIndex >= 0 And e.ColumnIndex = 2) Then
Dim total = 0, value = 0
Dim result = False
For i As Integer = 0 To Me.DataGridView1.ColumnCount - 2
If Not (Me.DataGridView1.Rows(e.RowIndex).Cells(i).Value Is
Nothing) Then
result =
Integer.TryParse(Me.DataGridView1.Rows(e.RowIndex).Cells(i).Value.ToString()
, value)
If (result) Then
total += value
End If
End If
Next
Me.DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value =
total
End If
End Sub

Private Sub DataGridView1_CellValueChanged(ByVal sender As Object,
ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles
DataGridView1.CellValueChanged
If (e.ColumnIndex > -1 And e.ColumnIndex <> 2 And e.RowIndex > -1)
Then
Me.DataGridView1.InvalidateCell(2, e.RowIndex)
End If
End Sub
End Class
Total Rows - Self calculating total rows (col and row locations). This
would work for when the grid is bound or unbound

You could get the total rows count via the Rows.Count or RowCount property
of the DataGridView.
Save/export to excel.

I find a sample which exports the data in a DataGrid to Excel. I think this
method also applies to DataGridView. Below is the link of the sample:
http://www.codeproject.com/office/datagridexcelexport.asp
Save/load from a access or SQL database.

This is a basic function of a DataGridView. Usually we use a DataAdapter or
TableAdapter to retrieve the data from the database and fill the returned
data in a DataTable. Then we could set the DataSource property of the
DataGirdView to the DataTable, so that the data will be shown in the
DataGridView.

For more information on DataGridView control in .NET 2.0, you may refer to
the following MSDN documents:

'DataGridView Control Overview (Windows Forms)'
http://msdn2.microsoft.com/en-us/library/k39d6s23.aspx

'DataGridView Control (Windows Forms)'
http://msdn2.microsoft.com/en-us/library/e0ywh3cz.aspx

Hope this helps.
If you have any question, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
"Mr. Arnold" <MR. (e-mail address removed)>'s wild thoughts were
released on Mon, 3 Sep 2007 18:38:25 -0400 bearing the
following fruit:
I used the Farpoint Spreadsheet VB 6 COM component back in 1999-2000 on very
complicated accounting solutions. Hopefully, they still have a trial ware
full featured .Net component like they had for VB 6 that you can try. Or you
could InterOp the COM solution into .Net.

Http://www.fpoint.com/

I can second that recommendation. Not sure about built in
calculations as I've never had the need.

My other favorite grid control is by devexpress

www.devexpress.com
 
Jan Hyde (VB MVP) said:
"Mr. Arnold" <MR. (e-mail address removed)>'s wild thoughts were
released on Mon, 3 Sep 2007 18:38:25 -0400 bearing the
following fruit:


I can second that recommendation. Not sure about built in
calculations as I've never had the need.

My other favorite grid control is by devexpress

www.devexpress.com

Yes I did demo Devexpress back in 2004, and I liked that one as well. The
Farpoint Spread Sheet was simply fabulous, which the MS solutions at the
time just couldn't provide the horsepower that was needed to make the
applications sing and impress the end-user base.
 
"Mr. Arnold" <MR. (e-mail address removed)>'s wild thoughts were
released on Tue, 4 Sep 2007 16:06:50 -0400 bearing the
following fruit:
Yes I did demo Devexpress back in 2004, and I liked that one as well. The
Farpoint Spread Sheet was simply fabulous, which the MS solutions at the
time just couldn't provide the horsepower that was needed to make the
applications sing and impress the end-user base.

Devexpress has done a lot since 2004, might be worth
checking back. I'm sure either farpoint or devexpress will
impress and IMO well worth the money.
 
Hi Aussie,

Further to what was mentioned, we (FarPoint) do offer a specific .NET
spreadsheet component, Spread for Windows Forms. Here's the link for
the main product page - http://www.fpoint.com/netproducts/spreadwin/spreadwin.aspx.
It does do all that you listed
Cell Calculation.. Like excel does (=sum(cell1 + cell2)) and other basic calculations
Spread for Windows Forms supports well over 300 functions, including
SUM. Here's the page that lists all the supported functions -
http://www.fpoint.com/netproducts/spreadwin/tour/formulas/default.aspx.
Setting up the formula is very straightforward. This sets up a formula
in cell A1. Spread takes care of the rest:
FpSpread1.Sheets(0).Cells(0, 0).Formula = "SUM(C1:C4)
Save/export to excel.
We read and write native Excel BIFF8 files (Excel 97 and above):
Open an Excel File - FpSpread1.OpenExcel("c:\excelFile.xls")
Save an Excel File - FpSpread1.SaveExcel("c:\excelFile.xls")
Save/load from a access or SQL database.
You can use Spread in bound mode or unbound mode

Following is the link to download a fully-functional 30-day trial:
http://www.clubfarpoint.com/FarPointSupportSite/Modules/Download/trials.aspx?pcode=spreadwin

If you have any questions, please feel free to make use of our support
forums. They are very quick to answer any questions that you may have:
http://www.clubfarpoint.com/Forums/forums/default.aspx

As an FYI, we do still actively support our VB6 version, Spread 7.

And thanks Jan and Mr. Arnold for the recommendation :)

- Donald
FarPoint Technologies
www.FarPointSpread.com
 
Hi Aussie,

How about the problem now?

If you need our further assistance, please feel free to let us know.

Thank you for using our MSDN Managed Newsgroup Support Service!

Sincerely,
Linda Liu
Microsoft Online Community Support
 
Back
Top