473,486 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1253

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
3444
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
6653
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
5529
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
242
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
4311
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
1848
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
763
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
7749
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
5790
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
7123
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
7175
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...
1
6842
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7319
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...
1
4864
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3069
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
262
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.