We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

GridDataBoundGrid won’t render properly

Hi,

I am having a display issue with my gridDataBoundGrid. I am manipulating the column orientations in the grid_PrepareViewStyleInfo using something like this


if(e.ColIndex >= 1)
{
if (e.RowIndex == 0)
{
string strColumnName = this.grid.Binder.InternalColumns[e.ColIndex - 1].MappingName;

if (strColumnName.IndexOf(@"\") != -1)
{
e.Style.Font.Orientation = 270;
e.Style.WrapText = false;
grid.Model.RowHeights[0] = colHeaderHeight;
grid.Model.ColWidths[e.ColIndex] = colHeaderWidth;
}
}
}

if(e.ColIndex == grid.Model.ColCount && e.RowIndex == grid.Model.RowCount)
{
grid.Refresh();
}

When I run the application, the grid doesn’t display correctly sometimes (not always), as seen in the attached snapshot. When I select a cell in the grid or move to other window and come back to the grid window or hover on the mis-displayed cells/columns, the grid fixes itself.

I am forcing a grid refresh as shown in the above code. Which other event should I use for my refresh rather?

Can you please give me some advice on how I can fix this problem?

Thanks,
Ranu


GridDisplayIssue1.zip

1 Reply

RG Ranu Gupta August 29, 2007 06:24 PM UTC


just fixed the issue. Using QueryColWidth and QueryRowHeight events rather.

Thanks,
Ranu

Loader.
Live Chat Icon For mobile
Up arrow icon