Solved

VB.NET DataGrid

Posted on 2002-04-22
5
2,750 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
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 50 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

770 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