I am trying to create a Web Part that will show information in a DataGrid, but I want to be able to sort and page the data. I've programmatically added a DataGrid to the Control, populated it, and set "AllowSort = True". I've created an event handler for the Sort and wired it up. However, when the DataGrid renders, it does not render the header text as links with a postback. I've tried setting the AllowSort property in different areas of my code including the CreateChildControls and RenderWebPart methods, but it does not seem to make a difference. Is there any way to get this to work in a WebPart?
I've also tried inheriting or adding a DataViewWebPart to my custom WebPart to give me all the paging/sorting/filter capabilities, but could not figure out how to programmatically work with this WebPart. I can add it to the control, but can't populate it with any data. Has anyone successfully done this?
btw.. the reason I'm not just directly using the DVWP is because the system needs to use SSO to pass credentials through a 3rd party dll (in the GAC) to connect to the other datasource. And I'll be using this control on multiple pages.