Gridview returns old value of gridview.rows.count!

M

MC

I have a label that shows the number of records returned by my
gridview. So after gridview ondatabound event I check to see if the
gridview.rows.count > 0, and if true then show row count in label but
empty gridviews my label shows an old row count of the previous
gridview. What can I do to get the current row count?

Thanx in advanx.
 
M

MC

Never mind... I realized that I had a condition which didn't clear the
label if the gridview returned 0 count.
Is associating the label to the ondatabound event the best way to show
row count? Any other/better ways?
Thanx.
 
Joined
Dec 12, 2008
Messages
1
Reaction score
0
Easiest Way

if you are using select method you can use:

DataView dv = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);
TextBox1.Text = dv.Table.Rows.Count.toString() + " registro(s) encontrado(s).";
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,525
Members
44,997
Latest member
mileyka

Latest Threads

Top