Hidden rows and columns, depending on the provider implementation, can be loaded in the UI Automation tree and will therefore be reflected in the RowCount and ColumnCount properties. If the hidden rows and columns have not yet been loaded they will not be counted.
///<summary>/// Gets the count of columns in the grid. ///</summary>///<remarks>/// gridItems is a two-dimensional array containing columns /// in the second dimension. ///</remarks>int IGridProvider.ColumnCount
return gridItems.GetUpperBound(1) + 1; ;