blank datagrid cells

blank datagrid cells

Post by beverl » Wed, 17 Jul 2002 23:45:20



I have a problem with a datagrid. I have created a datagrid
where the row color alternates to make it more readable.
This datagrid contains 5 columns.  One column is a comment
field and text is optional.  If the comment field is blank
(not containing text - letters), that entire cell is blank
- meaning that there are no cell boundaries nor background
color in that cell.

I've tried making the comment field value not null -
meaning that if there's not a comment the field contains a
space or multiple spaces. This doesn't work either. The
cell will be "blank" unless the field contains letters.  
Can someone tell me how to allow the comment field to be
blank, yet have the cell display properly with gridlines
and the appropriate background color.

 
 
 

blank datagrid cells

Post by Jayesh Pate » Thu, 18 Jul 2002 00:38:36


Trying putting    in html text. This represent a white space.


Quote:> I have a problem with a datagrid. I have created a datagrid
> where the row color alternates to make it more readable.
> This datagrid contains 5 columns.  One column is a comment
> field and text is optional.  If the comment field is blank
> (not containing text - letters), that entire cell is blank
> - meaning that there are no cell boundaries nor background
> color in that cell.

> I've tried making the comment field value not null -
> meaning that if there's not a comment the field contains a
> space or multiple spaces. This doesn't work either. The
> cell will be "blank" unless the field contains letters.
> Can someone tell me how to allow the comment field to be
> blank, yet have the cell display properly with gridlines
> and the appropriate background color.


 
 
 

1. datalist iterates through dastaset records but renders only blank table cells

I've experienced the most unusual contorl behavior
I bind a datalist (or datagrid) to a dataset
The rendered html page contains the row and cell html tags
but there is no
data displayed

Here's the code that I use:
      Dim cn As New SqlClient.SqlConnection("data
source=10.1.0.13;user
id=usr;pwd=password")
      Dim da As New SqlClient.SqlDataAdapter("Select top 5
OptID,
OptCategory, OptShort, OptLong from R2Kdoi..Options where
OptCategory =
'lstServices'", cn)
      Dim ds As New DataSet()
      Dim dl As New DataList()
      da.Fill(ds, "Options")
'formatting code
      dl.Visible = True
      dl.BorderStyle = BorderStyle.Solid
      dl.BorderColor = System.Drawing.Color.Navy
      dl.BorderWidth = Unit.Pixel(1)
      dl.GridLines = GridLines.Both
      dl.DataKeyField = "OptID"
'making sure there is data in the dataset
      Response.Write("ds.Tables(0).Rows.Count.ToString:" &
ds.Tables(0).Rows.Count.ToString & vbCrLf)
'final binding
      dl.DataSource = ds.Tables(0).DefaultView
      dl.DataBind()

Here's how my web page loks like after rendering (cleaned
of viewstate code
and headers):

ds.Tables(0).Rows.Count.ToString:5       'this shows me
that I have 5
records in the dataset
<table id="_ctl0" cellspacing="0" rules="all"
bordercolor="Navy" border="1"
style="border-color:Navy;border-width:1px;border-
style:Solid;border-collapse
:collapse;">
    <tr><td></td></tr>
    <tr><td></td></tr>
    <tr><td></td></tr>
    <tr><td></td></tr>
    <tr><td></td></tr>
</table>

'notice the 5 iterations that created each row and a blank
table cell

What gives?

2. How do Springboard flash modues work?

3. table cell..blankety blank

4. Help: how about Apple Select 360 for PC?

5. Prevent DataGrid cell highlighting when cell clicked

6. Cannot print via network with lprportd

7. WinForm Datagrid - Cell Color based on Cell Data

8. How good are Suns TFT's? any alternatives?

9. populate value in a cell on click of hyperlink of that cell in DataGRid

10. BUG: Design view gets blank, (Was: Design view gets blank but exe is ok..)

11. Changing the null value to blank in the datagrid in vb.net????

12. Datagrid being blanked out

13. Show 0 / blank instead of (Null) in DataGrid