Filter Datagrid?

Discussion in 'ASP .Net Datagrid Control' started by Jason ., May 3, 2006.

  1. Jason .

    Jason . Guest

    I have 3 datagrids on my page that uses data from one stored proc. The
    data is sorted by category (3 categories). Can I use the data from
    mystored proc to fill the datagrid without having to create three trips
    to the server to load the data?

    in pseudocode:

    If category = 1 then load that data into grid 1

    If category = 2 then load that data into grid 2

    If category = 3 then load that data into grid 3

    Thanks.



    *** Sent via Developersdex http://www.developersdex.com ***
    Jason ., May 3, 2006
    #1
    1. Advertising

  2. Jason .

    Jason . Guest

    I don't know if this is the best way to go about it but I was able to
    figure it out...

    // Create dataviews to hold the table to filter
    DataView dv1 = new DataView(ds.Tables["Results"]);
    DataView dv2 = new DataView(ds.Tables["Results"]);
    DataView dv3 = new DataView(ds.Tables["Results"]);
    DataView dv4 = new DataView(ds.Tables["Results"]);
    DataView dv5 = new DataView(ds.Tables["Results"]);

    dv1.RowFilter = "SortId = 0";
    dv2.RowFilter = "SortId = 1";
    dv3.RowFilter = "SortId = 2";
    dv4.RowFilter = "SortId = 3";
    dv5.RowFilter = "SortId = 5";




    *** Sent via Developersdex http://www.developersdex.com ***
    Jason ., May 4, 2006
    #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. =?Utf-8?B?UGVkb3I=?=

    datagrid filter for specific record(s)

    =?Utf-8?B?UGVkb3I=?=, Jan 22, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    3,237
    =?Utf-8?B?UGVkcm8=?=
    Jan 23, 2004
  2. RockNRoll
    Replies:
    1
    Views:
    3,429
    Raterus
    Aug 2, 2004
  3. Eric

    RE: q: filter datagrid

    Eric, Jun 14, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    367
  4. =?Utf-8?B?SnVhbmpv?=

    Filter data of a dropdownlist in datagrid

    =?Utf-8?B?SnVhbmpv?=, Nov 9, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    4,851
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    Nov 10, 2005
  5. zax75
    Replies:
    1
    Views:
    1,087
Loading...

Share This Page