Thanks!
Jerry
>Hi Jerry,
>
>DataGrid background color property is ignored by DataGrid control. By default it is set to System.Color.Gray. It is still possible to change it using System.Reflection namespace components
>
>
>using System.Reflection;
>
>public static void SetGridBackColor(DataGrid dg, Color color)
>{
> object oRenderer = typeof(DataGrid).GetField("m_renderer", BindingFlags.NonPublic|BindingFlags.Instance).GetValue(dg);
> oRenderer.GetType().GetField("m_brushEmptyBack", BindingFlags.NonPublic|BindingFlags.Instance).SetValue(oRenderer, new SolidBrush(color) );
>}
>
>
>
>>Using a grid in a C# Winform, I defined a few columns and bound data to the grid.
>>
>>The data displays fine, but the grid height is set to display 10 rows at a time. However, sometimes there is less than 10 rows in the dataset. In this case, the rows with data display fine, that is the grid's background colors display fine, but the rest of the grid's background color is a dark grey.
>>
>>How can I ensure that my whole grid is always displayed in my defined colors, not just the portion of the grid that has rows?
>>
>>Thanks,
>>
>>Jerry