re-ordering rows/records in datagrid

Discussion in 'ASP .Net' started by Patrick.O.Ige, Feb 8, 2006.

  1. I would like to re-order my rows in the datagrid.
    So on each row i want to have up and down images to go up one row or down
    Whats the easiest way to tackle this?
    Any sample guides are welcome.
    Patrick.O.Ige, Feb 8, 2006
    #1
    1. Advertising

  2. Patrick.O.Ige

    Remy Guest

    Remy, Feb 8, 2006
    #2
    1. Advertising

  3. Thx for the reply
    Remy what i want is to Move up level or down one level between rows
    I don't want to do sorting really but want to re-arrange the rows
    accordingly
    This post is very similar of what i want to do
    http://aspadvice.com/lists/message.aspx?MessageID=97710


    "Remy" <> wrote in message
    news:...
    > Its pretty much built into the new ASP.NET 2.0 GridView.
    > http://www.asp.net/QuickStart/aspnet/samples/data/GridViewSorting_vb.aspx
    > http://asp.net/Tutorials/quickstart.aspx
    >
    > for normal asp, its not complicated either:
    >

    http://msdn.microsoft.com/library/d...ml/vbtskaddingsortingtodatagridwebcontrol.asp
    >
    > Have fun
    >
    > Remy
    >
    Patrick.O.Ige, Feb 8, 2006
    #3
  4. Hi Patrick,

    I put this demo quickly to answer your question:
    http://www.webswapp.com/codesamples/aspnet20/datatable_rowsreorder_ondatagrid/


    --
    HTH,
    Phillip Williams
    http://www.societopia.net
    http://www.webswapp.com


    "Patrick.O.Ige" wrote:

    > Thx for the reply
    > Remy what i want is to Move up level or down one level between rows
    > I don't want to do sorting really but want to re-arrange the rows
    > accordingly
    > This post is very similar of what i want to do
    > http://aspadvice.com/lists/message.aspx?MessageID=97710
    >
    >
    > "Remy" <> wrote in message
    > news:...
    > > Its pretty much built into the new ASP.NET 2.0 GridView.
    > > http://www.asp.net/QuickStart/aspnet/samples/data/GridViewSorting_vb.aspx
    > > http://asp.net/Tutorials/quickstart.aspx
    > >
    > > for normal asp, its not complicated either:
    > >

    > http://msdn.microsoft.com/library/d...ml/vbtskaddingsortingtodatagridwebcontrol.asp
    > >
    > > Have fun
    > >
    > > Remy
    > >

    >
    >
    >
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=, Feb 8, 2006
    #4
  5. Patrick.O.Ige

    Rote Rote Guest

    Thanks Phillip for the email and the hint and the approach
    Will i be able to bind it to a table with this structure
    id doc rank
    1 a.doc 1
    2 b.doc 2
    3 c.doc 3
    4 d.oc 4

    What i really want to achieve is to be able to rank the doc files on
    that table from 1-4 with no duplicates.
    Would it be easy to retrieve my data from the database table to achieve
    the same result?
    Patrick

    *** Sent via Developersdex http://www.developersdex.com ***
    Rote Rote, Feb 9, 2006
    #5
  6. Hello Patrick,

    Sorting based on a Rank field might eliminate the issue you encountered to
    save the datatable. Try this demo:

    http://www.webswapp.com/codesamples/aspnet20/datatable_rowsreorder_ondatagrid/sort_on_rank.aspx
    --
    HTH,
    Phillip Williams
    http://www.societopia.net
    http://www.webswapp.com


    "Patrick.O.Ige" wrote:

    > Phillip i have taken time to look at your interesting sample
    > and i could move up and down the row using values from a table in the DB but
    > i need to update changes to the table
    > I hooked it up with a submit button but it doesn't change the values
    > any ideas.. sleeping.:(:(
    >
    > void Bind()
    > {
    > if (Session["FilesOrder"] == null)
    > {
    > dt = new DataTable("FilesOrder");
    > const string strSQL = "select * from FilesOrder";
    > SqlCommand myCommand = new SqlCommand(strSQL, myConnection);
    > SqlDataAdapter myAdapter = new SqlDataAdapter(myCommand);
    > myConnection.Open();
    > myAdapter.Fill(dt);
    > Session["FilesOrder"] = dt;
    > }
    > else
    > {
    > dt = (DataTable)Session["FilesOrder"];
    > }
    >
    >
    > "Rote Rote" <> wrote in message
    > news:...
    > > Thanks Phillip for the email and the hint and the approach
    > > Will i be able to bind it to a table with this structure
    > > id doc rank
    > > 1 a.doc 1
    > > 2 b.doc 2
    > > 3 c.doc 3
    > > 4 d.oc 4
    > >
    > > What i really want to achieve is to be able to rank the doc files on
    > > that table from 1-4 with no duplicates.
    > > Would it be easy to retrieve my data from the database table to achieve
    > > the same result?
    > > Patrick
    > >
    > > *** Sent via Developersdex http://www.developersdex.com ***

    >
    >
    >
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=, Feb 10, 2006
    #6
  7. Thanks alot Phillip
    I would try that out

    "Phillip Williams" <> wrote in message
    news:...
    > Hello Patrick,
    >
    > Sorting based on a Rank field might eliminate the issue you encountered to
    > save the datatable. Try this demo:
    >
    > http://www.webswapp.com/codesamples/aspnet20/datatable_rowsreorder_ondatagrid/sort_on_rank.aspx
    > --
    > HTH,
    > Phillip Williams
    > http://www.societopia.net
    > http://www.webswapp.com
    >
    >
    > "Patrick.O.Ige" wrote:
    >
    >> Phillip i have taken time to look at your interesting sample
    >> and i could move up and down the row using values from a table in the DB
    >> but
    >> i need to update changes to the table
    >> I hooked it up with a submit button but it doesn't change the values
    >> any ideas.. sleeping.:(:(
    >>
    >> void Bind()
    >> {
    >> if (Session["FilesOrder"] == null)
    >> {
    >> dt = new DataTable("FilesOrder");
    >> const string strSQL = "select * from FilesOrder";
    >> SqlCommand myCommand = new SqlCommand(strSQL, myConnection);
    >> SqlDataAdapter myAdapter = new SqlDataAdapter(myCommand);
    >> myConnection.Open();
    >> myAdapter.Fill(dt);
    >> Session["FilesOrder"] = dt;
    >> }
    >> else
    >> {
    >> dt = (DataTable)Session["FilesOrder"];
    >> }
    >>
    >>
    >> "Rote Rote" <> wrote in message
    >> news:...
    >> > Thanks Phillip for the email and the hint and the approach
    >> > Will i be able to bind it to a table with this structure
    >> > id doc rank
    >> > 1 a.doc 1
    >> > 2 b.doc 2
    >> > 3 c.doc 3
    >> > 4 d.oc 4
    >> >
    >> > What i really want to achieve is to be able to rank the doc files on
    >> > that table from 1-4 with no duplicates.
    >> > Would it be easy to retrieve my data from the database table to achieve
    >> > the same result?
    >> > Patrick
    >> >
    >> > *** Sent via Developersdex http://www.developersdex.com ***

    >>
    >>
    >>
    Patrick.O.Ige, Feb 11, 2006
    #7
    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?Q2hyaXM=?=

    re-ordering rows/records

    =?Utf-8?B?Q2hyaXM=?=, Jan 27, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    434
    Eliyahu Goldin
    Jan 30, 2005
  2. nbigaouette

    Z-Ordering (Morton ordering) question

    nbigaouette, Nov 5, 2009, in forum: C Programming
    Replies:
    2
    Views:
    2,149
  3. bathoi
    Replies:
    0
    Views:
    879
    bathoi
    Jul 6, 2010
  4. Replies:
    3
    Views:
    203
  5. Achim Domma (SyynX Solutions GmbH)

    support for ordering records in rails

    Achim Domma (SyynX Solutions GmbH), Oct 22, 2005, in forum: Ruby
    Replies:
    2
    Views:
    145
    Eric Hodel
    Oct 23, 2005
Loading...

Share This Page