Last post Jan 22, 2011 12:16 PM by Lateef045
Jan 21, 2011 04:56 PM|Bobby_S|LINK
I use the obout grid control throughout my app. I would like to control grid properties like PageSize from one location (web.config). However, I don't want to override the grid properties if it is specified in the control attributes. So in my function I
public void SetGridProperties(Grid grid)
// do not override the property value if already set
if (grid.PageSize == null)
if (Int16.TryParse(ConfigurationManager.AppSettings["GridPageSize"], out pageSize))
grid.PageSize = pageSize;
The problem is that grid.PageSize is never null. It defaults to 10 if the user does not explicitly specify the value, so I can't determine if the value was specified by the coder or by obout. Any ideas how can I accomplish this?
Jan 22, 2011 12:16 PM|Lateef045|LINK
The page size property will never be null. It will default to 10 if not explicitly set by the user.
Instead of checking for PageSize, check if AllowPaging is set to true. If the user has not set AllowPaging to true, chances are that he might not have set the PageSize also.
Not the correct answer to what you asked, but maybe it gives you an idea.