Hi.
I am creating a dynamic datagrid. The columns are based on a request.querystring value. Eg: I will pass in a 'func=toys' parameter, which will cause the datagrid to load create columns specific to a toys xml file I pass in.
I have a problem with the sort functionality. I have created the sorting command handler and this works fine when the columns are not created dynamically.
I successfully create the columns for the datagrid in the page_load event and set the sortexpression
bcol.SortExpression = stgas[i,1];
where "stgas[i,1]" is the name of the sortfield.
My problem is that the sort command handler is not run when I click sort.
I've heard that the code to create the columns should be in the Page_Init function as this is where the event handler is initialised, but I can't access the 'HttpRequest' object at this point, thus I can't determine which columns should be created here.
Appreciate any help.
Thanks
-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>nUd0T7ZHlUCEVIGQW3oxhA==</Id>