Problem with Gridview and SP without results

A

anr

hi all,

first of all, i'm sorry for my english!!

i have a problem with my gridview on an asp.net page.

The gridview shows bassically numbers and works with a SP
fine, but when the SP returns 0 row, the asp.net page
fails... i have in the gridview rowdatabound code, that
when a number is negative show it in red color...

Code:
If Convert.ToDecimal(e.Row.Cells.Item(i).Text) < 0 Then
       e.Row.Cells.Item(i).ForeColor = Drawing.Color.Red
End If

I included the property EmptyDataText for the gridview, for
when the gridview returns nothing, the grid shows that
EmptyDataText, but the page crashes in the rowdatabound
code (more specific in the if of the color code - without
any possibility of debug normally)...

Does anyone have a solution for this problem?

Thanks!!

thx for the help! :D
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top