views:

105

answers:

0

Hi all

I am writing a web part which uses the SPGridView to display the data from SQL Server 2005. I am using the ObjectDataSource as the data source control.

Right noW, I can display the data from the sql server. I also can sort,fillter and update the item in the SPGridView. But I still have some problem, maybe someone meet them before.

1.At the moment, I have added the filters to the many columns in the SPGridView like the List View in SharePoint. I can filter items using one filter. But when I try to use the second filter based on the result of last filtering, it would reload all data and only use the second filter. How can I use both of them?

2.I want to get the filtered items after filtering. For example, when I first open the page, it would load 100 items in the SPGridView. Then I use the filter to get 50 items. Now, I only want to get the 50 items. I try to use the SPGridView.Rows to get the 50 items, but it returns 100 items which means all items. How can I just get the filtered items.

3.I add a Edit field in the SPGridView, so I can update the data from the SPGridView. But there is a problem. For example, at first, the web part return 100 items. Then I get 50 items using a filter. I click the Edit link button of the firs item, after postback , I found the Editing item is not the item I am trying to edit. The editing item becomes the first item of all items, not the first item of filtered item. Does anyone meet it before?

Best Regards,