472,328 Members | 1,199 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,328 software developers and data experts.

Problem with empty cell value in GridView

I have an cell which contains a field member which is filled with
String.Empty. When I retrieve the value in the cell with
Cells[0].Text.ToString() and try to compare it to String.Empty, I can't
because it contains "&nbsp". I really don't want to compare the value to
that so how can I retrieve an empty cell so that it is String.Empty.

Bill
Aug 6 '07 #1
3 3227
"Bill Gower" <bi*******@charter.netwrote in message
news:u0****************@TK2MSFTNGP05.phx.gbl...
Ok that's fine. I won't make it more difficult then it is. :) But now I
do have a real problem. I am retrieving the 3rd row which happens to have
no value in the cell and it is actually containing the value from the
first row same cell. When the gridview is displayed it is an empty cell
but when I retrieve it by

GridView.Rows[index].Cells[0].Text.ToString().

It has the value of the cell from the first row.

What is happening here?
Difficult to tell without seeing your code but, if you do a View Source on
the page in question, you will see the HTML table rendered from the GridView
webcontrol - does that shed any light on it...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 6 '07 #2
I checked the source and rows 1 to 3 have an entry in the cell and rows 4
to 5 have &nbsp in the cell. When I step through the code and check the
value at the cell from row 4, it has the value from the cell in row 1.

Bill
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:OU**************@TK2MSFTNGP02.phx.gbl...
"Bill Gower" <bi*******@charter.netwrote in message
news:u0****************@TK2MSFTNGP05.phx.gbl...
>Ok that's fine. I won't make it more difficult then it is. :) But now I
do have a real problem. I am retrieving the 3rd row which happens to
have no value in the cell and it is actually containing the value from
the first row same cell. When the gridview is displayed it is an empty
cell but when I retrieve it by

GridView.Rows[index].Cells[0].Text.ToString().

It has the value of the cell from the first row.

What is happening here?

Difficult to tell without seeing your code but, if you do a View Source on
the page in question, you will see the HTML table rendered from the
GridView webcontrol - does that shed any light on it...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 6 '07 #3
"Bill Gower" <bi*******@charter.netwrote in message
news:%2*****************@TK2MSFTNGP04.phx.gbl...
>I checked the source and rows 1 to 3 have an entry in the cell and rows 4
to 5 have &nbsp in the cell. When I step through the code and check the
value at the cell from row 4, it has the value from the cell in row 1.
Please show the code you're using...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 7 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Mark Olbert | last post by:
I ran into a situation this morning where the RowUpdating event of a GridView kept insisting there were no entries in either the OldValues or...
4
by: Ken Wigle | last post by:
All, I would be very grateful for any help on this question. I have an application in asp.net 2.0 where I dynamically create a datatable and...
1
by: Martin | last post by:
Hi, I'm having a problem with a datagridview control when trying to read the value of an unbound checkbox cell. The code below works fine if I...
1
by: K B | last post by:
I would like to create a gridview as below: Project Name 1-1 1-2 1-3 1-4 1-5 1-6 Project 1 BLUE BLUE BLUE BLUE GREEN ...
14
by: Mike | last post by:
I have a gridview that has a button in the last cell of each row. I want to get the text from cell 1 for that row the button was clicked on. So...
3
by: gnewsgroup | last post by:
I have a GridView which is bound to my database. The leftmost column of the GridView has a value of either 0 or 1, and I need to highlight the...
2
by: Bart | last post by:
Hi, i need to check wether a cell of a gridview is empty or not. I did this: Protected Sub GridView1_SelectedIndexChanged(ByVal sender As...
1
Frinavale
by: Frinavale | last post by:
I'm working on an ASP.NET application using VB.NET for server side code. I have a GridView listing a bunch of stuff. Above the GridView I have a...
1
nitindel
by: nitindel | last post by:
Hi All, Please tell me any good site for Gridview control.(not for datagrid). I am facing error in fetching the values of the Bound columns...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
1
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.