Find Feature in DataGrid

Discussion in 'ASP .Net Web Controls' started by Holysmoke, Jun 30, 2004.

  1. Holysmoke

    Holysmoke Guest

    Hi,

    I just like to implement a find feature in DataGrid. And the DataGrid is paged. I found some code sample to implement a search feature. It does n't help me because they Filter the Data and show the results on the datagrid.

    I don't want to implement the Filter in SQL. Consider a DataGrid having 10 Pages and I have a string "Holysmokes" in Page 5. From Page 1 If i find a that string, I should go to Page 5 and not by filtering and showing the data. I just want to move the pointer. That's it. I see a Find method in DataView object which returns the row number but don't know how to use it with Paged DataGrid.

    I appreciate your help,

    TIA,
    Holy
    Holysmoke, Jun 30, 2004
    #1
    1. Advertising

  2. there's no easy way around it. use the filter method of either the dataview
    or the dataset. when you find the item you will have to calculate what page
    it is on and move the page index to the correct page. the calculation isn't
    terribly difficult since you know the index it is in the container and how
    many pages the grid contains as well as how many items fit on one page.
    don't forget to include the last page since all rows do not necessarily fill
    up the last page and it may throw your calculation off.

    --
    Regards,
    Alvin Bruney
    [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
    Got tidbits? Get it here... http://tinyurl.com/27cok
    "LisaConsult" <> wrote in message
    news:...
    >I have this issue as well. Did you find a solution? Does anyone have any
    >ideas?
    >
    > Thanks.
    >
    > "Holysmoke" wrote:
    >
    >> Hi,
    >>
    >> I just like to implement a find feature in DataGrid. And the DataGrid is
    >> paged. I found some code sample to implement a search feature. It does
    >> n't help me because they Filter the Data and show the results on the
    >> datagrid.
    >>
    >> I don't want to implement the Filter in SQL. Consider a DataGrid having
    >> 10 Pages and I have a string "Holysmokes" in Page 5. From Page 1 If i
    >> find a that string, I should go to Page 5 and not by filtering and
    >> showing the data. I just want to move the pointer. That's it. I see a
    >> Find method in DataView object which returns the row number but don't
    >> know how to use it with Paged DataGrid.
    >>
    >> I appreciate your help,
    >>
    >> TIA,
    >> Holy
    Alvin Bruney [MVP], Jul 19, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. nospam
    Replies:
    1
    Views:
    387
    William Ryan
    Sep 18, 2003
  2. Zean Smith

    DataGrid Color - Annoying feature

    Zean Smith, Jan 20, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    389
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    Jan 20, 2006
  3. Wybo Dekker
    Replies:
    1
    Views:
    352
    Yukihiro Matsumoto
    Nov 15, 2005
  4. vdvorkin
    Replies:
    0
    Views:
    401
    vdvorkin
    Feb 10, 2011
  5. vdvorkin
    Replies:
    3
    Views:
    809
    vdvorkin
    Feb 14, 2011
Loading...

Share This Page