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

GridLines are not displaying properly

1 Answer 58 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gitanjali
Top achievements
Rank 1
Gitanjali asked on 23 Feb 2009, 12:49 PM
im using dataformat property in my Grid as i don't want wrapping in my grid cell [in column created event handler] and for this im setting property as follows:

 

 

if

(e.Column.ColumnType == "GridBoundColumn")

 

{

((

GridBoundColumn)e.Column).DataFormatString = "<nobr>{0}</nobr>";

 

}

But after applying this property grid lines are not displaying properly wherever blank space is coming in a cell.

 

please provide me a solution as i want grid lines also in my grid.

 

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 24 Feb 2009, 04:51 AM
Hi Gitanjali,

Try the following code snippet in the Prerender event of the Grid and see whether it is helpful.

CS:
protected void RadGrid2_PreRender(object sender, EventArgs e)  
    {  
        foreach (GridDataItem dataItem in RadGrid2.Items)  
        {  
            foreach (GridColumn col in RadGrid2.Columns)  
            {  
                if (dataItem[col.UniqueName].Text == string.Empty)  
                    dataItem[col.UniqueName].Text += "&nbsp;";    
   
            }  
        }  
    }  


Shinu



Tags
Grid
Asked by
Gitanjali
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or