This is a migrated thread and some comments may be shown as answers.

How to: Rows.Count

7 Answers 632 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 09 Jul 2010, 06:49 AM
hy everybody

is there an easy was to retrieve the number of rows of the GridView element i.e. gridview.rows.count? My intention is to build a loop i.e.
for i = 0 to gridview.rows.count - 1
...do something
next

Thanks for your help

Michael Lutz
BITsoft

7 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 09 Jul 2010, 06:54 AM
Hello Michael,

 You can use Items property instead. 

Regards,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Michael
Top achievements
Rank 1
answered on 09 Jul 2010, 07:57 AM
Perfekt! That does the job.

I appreciate the outstanding support :-)

best regards,

Michael Lutz
BITsoft
0
Michael
Top achievements
Rank 1
answered on 09 Jul 2010, 11:11 AM
hello - I am sorry but I was a little to fast saying it does the job. Regardless how many rows are filled and visible, the following vb.net code gives me the value 0:

for i as integer = 0 to me.radgridview1.items.count-1
...do some work
next

any idea what I am doing wrong?

best regards,

Michael Lutz
BITsoft
0
Vlad
Telerik team
answered on 09 Jul 2010, 12:01 PM
Hi Michael,

 Can you post more info where exactly this code will be executed? Button click? Other event?

Regards,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Michael
Top achievements
Rank 1
answered on 09 Jul 2010, 12:15 PM
Hy

the event is "RadGridView1_SelectionChanged"

thanks

Michael Lutz
BITsoft
0
Vlad
Telerik team
answered on 13 Jul 2010, 04:12 PM
Hello Michael,

 I've just tried this however everything worked as excepted on my end. Please check the attached project for reference. 

Regards,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Michael
Top achievements
Rank 1
answered on 13 Jul 2010, 05:02 PM

dear Vlad,

 

thanks a lot. I will give it a try first thing tomorrow.

 

best regards,

 

Michael Lutz
BITsoft

Tags
GridView
Asked by
Michael
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Michael
Top achievements
Rank 1
Share this question
or