NEWS

Wednesday, August 3, 2011

RadGrid Item Missing Border when null

Sometimes, the cell border seems to disappear when the cell is empty, so probably you can add a white space( ) to the cell inorder to prevent this,

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 += " ";
             }
       }
}

There is another way.


You can edit inside the CSS if you use the custom Skin

.RadGrid_MySkin .rgMasterTable
{
      border-collapse:collapse !important;
}




No comments:

Post a Comment