Results 1 to 3 of 3

Thread: Best way to do a search for a datakey in the gridview bound to objectdatasource

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2006
    Posts
    589

    Best way to do a search for a datakey in the gridview bound to objectdatasource

    Hi,

    I haver an objectdatasource that gets data from business logic layer through typed dataset designer and tableadapter. then I have a gridview bound to the objectdatasource in the aspx view (no code behind s been written so far)

    The gridview has paging and sorting enabled. The datakey field is also a column displayed in my gridview.

    I need to implement this:

    On top of my web page , I have a texbox in which the user types in a value of the datakey to look for in my gridview. Then I should go through the gridview and find that searched datakey amongst the rows of my gridview (remember paging and sorting are enabled, so the searched datakey can be found in the 3rd or 4th page of the gridview).

    How can I implement this with the least amount of code, pls?

    p.s: pls remember that user can already select a column to sort the gridview, so i need that to be taken into consideration as well.



    Thanks for your patience for reading all this
    Thanks a lot for your help.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Best way to do a search for a datakey in the gridview bound to objectdatasource

    Are you able to specify SelectParameters using control IDs?

  3. #3
    Frenzied Member brin351's Avatar
    Join Date
    Mar 2007
    Location
    Land Down Under
    Posts
    1,293

    Re: Best way to do a search for a datakey in the gridview bound to objectdatasource

    It sounds like your saying if key 123 is on page 4 then show page 4 in the grid with that row highlighted?
    Or
    you have 100 rows on 10 pages of the grid someone types in key 123 then keep the 100 rows in sorted order just display the page it's on?

    You don't want to bind the results of a DB query for key 123 to your grid or sort key 123 to the top of page1?

    Is that correct?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width