Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VB.NET DataGrid

Posted on 2002-04-22
5
Medium Priority
?
2,778 Views
Last Modified: 2008-02-26
How to find the last row number ( the last column number) for DataGrid in VB.Net. IN VB6 it is DataGrid1.Columns.Count. I did not find such property in VB.NET. There is a property VisibleRowCount and VisibleColumnCount but it does not give the total quantity of rows.
0
Comment
Question by:iboutchkine
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6959912
have you tried something like :
((DataTable)dataGrid1.DataSource).Rows.Count
0
 
LVL 5

Accepted Solution

by:
rkot2000 earned 200 total points
ID: 6960344
   Dim x As Data.DataSet
    x.Tables("myTable").DefaultView.Count() 'rows
    x.Tables("myTable").Columns.Count() 'columns
0
 
LVL 28

Author Comment

by:iboutchkine
ID: 6960918
Worked as a charm!!!
0
 

Expert Comment

by:lovely_kishore
ID: 12206264
((DataTable)dglist.DataSource).Rows.Count

When i Tried the same code in vb.net the following error is displayed as tool tip
'DataTable' is a type and cannot be used as an expression.
can you give me the solution in vb.net

thanks in advance
email: kishore@sgstechnologie.com
0
 

Expert Comment

by:jhstinson
ID: 14683489
^ ^ You have to assign it to some integer
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question