473,395 Members | 1,677 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Maybe FlexGrid better choice in this case?

I loaded my datagrid. Now I need to step through the rows & columns to
parse the data contained in the cells. But there's no "rows.count" or
"columns.count" properties to read. How can I know the total rows & columns
in my data grid?

Also, how can I save the data in my grid to a csv file when I'm all done?

Thanks.
Nov 20 '05 #1
6 1251

You can get the column count using the GridColumnStylesCollection. Look
it up in MSDN to see how to use it. Use the search term
GridColumnStylesCollection.

Terry Olsen wrote:
I loaded my datagrid. Now I need to step through the rows & columns to
parse the data contained in the cells. But there's no "rows.count" or
"columns.count" properties to read. How can I know the total rows & columns
in my data grid?

Also, how can I save the data in my grid to a csv file when I'm all done?

Thanks.

Nov 20 '05 #2

You can get the column count using the GridColumnStylesCollection. Look
it up in MSDN to see how to use it. Use the search term
GridColumnStylesCollection.

Terry Olsen wrote:
I loaded my datagrid. Now I need to step through the rows & columns to
parse the data contained in the cells. But there's no "rows.count" or
"columns.count" properties to read. How can I know the total rows & columns
in my data grid?

Also, how can I save the data in my grid to a csv file when I'm all done?

Thanks.

Nov 20 '05 #3
I looked at GridColumnStylesCollection. Haven't been able to figure out how
to get the row & column counts out of it yet...but this is what I came up
with so far. It works unless the user enters a number greater than the
number of columns.

Dim intCol As Integer = Val(InputBox("Which column contains the Computer
Name's to query?", "Run Query"))

Dim intRow As Integer = 0

Dim msg As String

If intCol > 0 Then

Try

Do

msg = msg & DataGrid1.Item(intRow, intCol-1) & " : "

intRow += 1

Loop

Catch ex As Exception

MsgBox(msg, MsgBoxStyle.Information, "End of Rows reached. Total Rows: " &
intRow.ToString)

End Try

End If

"yEaH rIgHt" <no******@haha.com> wrote in message
news:10*************@corp.supernews.com...

You can get the column count using the GridColumnStylesCollection. Look
it up in MSDN to see how to use it. Use the search term
GridColumnStylesCollection.

Terry Olsen wrote:
I loaded my datagrid. Now I need to step through the rows & columns to
parse the data contained in the cells. But there's no "rows.count" or
"columns.count" properties to read. How can I know the total rows & columns in my data grid?

Also, how can I save the data in my grid to a csv file when I'm all done?
Thanks.

Nov 20 '05 #4
I looked at GridColumnStylesCollection. Haven't been able to figure out how
to get the row & column counts out of it yet...but this is what I came up
with so far. It works unless the user enters a number greater than the
number of columns.

Dim intCol As Integer = Val(InputBox("Which column contains the Computer
Name's to query?", "Run Query"))

Dim intRow As Integer = 0

Dim msg As String

If intCol > 0 Then

Try

Do

msg = msg & DataGrid1.Item(intRow, intCol-1) & " : "

intRow += 1

Loop

Catch ex As Exception

MsgBox(msg, MsgBoxStyle.Information, "End of Rows reached. Total Rows: " &
intRow.ToString)

End Try

End If

"yEaH rIgHt" <no******@haha.com> wrote in message
news:10*************@corp.supernews.com...

You can get the column count using the GridColumnStylesCollection. Look
it up in MSDN to see how to use it. Use the search term
GridColumnStylesCollection.

Terry Olsen wrote:
I loaded my datagrid. Now I need to step through the rows & columns to
parse the data contained in the cells. But there's no "rows.count" or
"columns.count" properties to read. How can I know the total rows & columns in my data grid?

Also, how can I save the data in my grid to a csv file when I'm all done?
Thanks.

Nov 20 '05 #5
Cor
Hi Terry,

When you use a single table in your datagrid it is easy
dv.count
or
dt.count

This is also with the columns when you use no columnstyle

I hope this helps?

Cor
Nov 20 '05 #6
Cor
Hi Terry,

When you use a single table in your datagrid it is easy
dv.count
or
dt.count

This is also with the columns when you use no columnstyle

I hope this helps?

Cor
Nov 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: selowan | last post by:
Hi, In VB6 Pro SP5, I have a form that contains an MSFlexGrid and a few other textboxes and comboboxes. I am using the technique from MSDN article Q241355, which describes how to tab and edit in...
4
by: VR | last post by:
I am trying to embed a check box into a FlexGrid's cell, but having a problem when I start scrolling the grid. Here is my MyCheckBox class... class MyCheckBox : CheckBox { void Init (...
9
by: JFB | last post by:
Hi All, I have a edit flexgrid, after to fill with different rows manually. How can I insert the rows of my flexgrid to my table (sql server) using ado.net? Any example? I can insert one row...
3
by: Terry Olsen | last post by:
I loaded my datagrid. Now I need to step through the rows & columns to parse the data contained in the cells. But there's no "rows.count" or "columns.count" properties to read. How can I know...
5
by: schapopa | last post by:
I have a flex grid and I am loading data to this flex grid in this way While sqldr.Read j = j + 1 MSFlexGrid1PLSummary.set_TextMatrix(MSFlexGrid1PLSummary.Row, MSFlexGrid1PLSummary.Col,...
8
by: Joshua Moore | last post by:
/* Hi, I was hoping someone could help me with this problem. I did my work and worked my way through the usual compiler messages, but I have run against some problem I can't identify. The compiler...
0
by: Biseo | last post by:
I have a Flexgrid name BMGrid1 with three Rows named in order LastName, FirstName and Locality (these fields are the field 3, 5, 8 of a database choice with a search). How can I print this BMGrid1?
3
by: sweevil | last post by:
I'm converting a VB6 project to .Net2005. One of the items encountered was setting the cellpicture onto a flexgrid from an imagelist. The image background doesn't appear to render correctly. I...
3
by: ArmageddonAsh | last post by:
I'm trying to make an application that will allow the user to enter data into a flexgrid (that's done) and then save the data from that flexgrid into a CSV file but even though the file is made none...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.