简体   繁体   中英

ASP.Net PagingBulletedList Extender For ASP.Net GridView

Does any one know of a control that i can use with a ASP.Net gridview that provides the functionality of the ASP.Net Ajax Control PagingBulletedList. I want to provide the users with a easier way to access the data in the grid.

It should ideally work in the same way paging for the grid works except that it should show all the data for the selected option ie if the letter a is selected all items that begin with a are shown to the user.

I would prefer not to have to re develop something like this as i am sure it exists, i just have no idea what would you call it.

Thanks in advance.

Unfortunatly there is nothing already buildt for this. To build your own you will have to create your own PagerTemplate .

There is something similiar with code in it in this tutorial . This tutorial migh help you well to achieve what you require. I would have done it differently with PagerTemplate instead of GridView Footer as show.

So basically to create the paging bar it would have give :

<asp:UpdatePanel runat="server" ID="UpdatePanel">
<asp:GridView runat="server" ID="GridView">
  <PagerTemplate>
    <asp:LinkButton runat="server" Text="A" Command="A" />
-
    <asp:LinkButton runat="server" Text="B" Command="B" />
-
    <asp:LinkButton runat="server" Text="C" Command="C" />
-
    <asp:LinkButton runat="server" Text="D" Command="D" />
-
    <asp:LinkButton runat="server" Text="E" Command="E" />
<%-- Continue at will... --%>
  </PagerTemplate>
</asp:GridView>
</asp:UpdatePanel>

Then you catch in the code behind the command and re create a new Datasource with only the data for the letter you need. You have to understand that GridView is bind to a Datasource that can't be manipulated. So when you initially show it, the datasource provider will only send the data with letter A. When you will click F then you will request you data provider to retreive only the information with Letter F and reassign the data to gridview : GridView.Datasource = mynewdata

Hope this helps

DataGrid has its own set of data sorting that you can tap, for example, you can page a GridView by adding 'AllowPaging="true"' in the gridview markup (or by code-behind, doesn't matter). You can also allow for sorting ('AllowSorting="true"').

Unfortunately, I haven't come across a control of such nature where you can filter based on letter. However, I did create a custom control for it that merely did a DataTable.Select() and rebounded the GridView to the new DataSet. It's really not all that hard to develop it, and it's good to have a control of such nature. One other thing too is you could add a textbox that will filter based on the results entered by the user - but that's more of a suggestion than solution.

Hope this helps!

it's ugly, but just have a paged datagrid, with a single cell that has a separate ul/li .. they'll line up together, and give you the functionality you want. Otherwise you may have to roll your own.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM