Solved

vb.net tableLayoutPanel.rowcount is incorrect

Posted on 2014-10-06
3
176 Views
Last Modified: 2014-10-21
Visually i have 10 rows on the screen
If i query the tableLayoutPanel.rowcount is always equals 2
this coincidentally equal my initial design time rows
i basically want to cycle through each control in the first column and need to know the number of rows
0
Comment
Question by:glenn_r
  • 2
3 Comments
 
LVL 79

Accepted Solution

by:
David Johnson, CD, MVP earned 500 total points
ID: 40364639
RowCount and ColumnCount don't return the number of items

You can specify both the ColumnCount and the RowCount properties for layouts with a known and fixed number of cells. You can also specify one property or the other if you expect the number of cells in your layout to grow, assuming that the GrowStyle property allows for such growth. If the value of RowCount is 0, the panel will grow by adding rows, and if the value of ColumnCount is 0, the panel will grow by adding columns. Specifying panel growth with the GrowStyle property is preferred to setting RowCount or ColumnCount to 0, however.
http://bit.ly/1vIINJx
0
 

Author Comment

by:glenn_r
ID: 40364732
how can i get the number of rows in the control?
0
 
LVL 79

Expert Comment

by:David Johnson, CD, MVP
ID: 40364831
if you want the number of rows returned
you need to use the SQL command rowcount
http://msdn.microsoft.com/en-CA/library/ms188774.aspx

USE AdventureWorks;
GO
SELECT count(*) AS Count
FROM Production.ProductInventory
WHERE Quantity < 300;
GO

Open in new window

0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

832 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