Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > re-ordering rows/records in datagrid

Reply
Thread Tools

re-ordering rows/records in datagrid

 
 
Patrick.O.Ige
Guest
Posts: n/a
 
      02-08-2006
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.


 
Reply With Quote
 
 
 
 
Remy
Guest
Posts: n/a
 
      02-08-2006
Its pretty much built into the new ASP.NET 2.0 GridView.
http://www.asp.net/QuickStart/aspnet...orting_vb.aspx
http://asp.net/Tutorials/quickstart.aspx

for normal asp, its not complicated either:
http://msdn.microsoft.com/library/de...webcontrol.asp

Have fun

Remy

 
Reply With Quote
 
 
 
 
Patrick.O.Ige
Guest
Posts: n/a
 
      02-08-2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> Its pretty much built into the new ASP.NET 2.0 GridView.
> http://www.asp.net/QuickStart/aspnet...orting_vb.aspx
> http://asp.net/Tutorials/quickstart.aspx
>
> for normal asp, its not complicated either:
>

http://msdn.microsoft.com/library/de...webcontrol.asp
>
> Have fun
>
> Remy
>



 
Reply With Quote
 
=?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
Guest
Posts: n/a
 
      02-08-2006
Hi Patrick,

I put this demo quickly to answer your question:
http://www.webswapp.com/codesamples/...er_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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) ups.com...
> > Its pretty much built into the new ASP.NET 2.0 GridView.
> > http://www.asp.net/QuickStart/aspnet...orting_vb.aspx
> > http://asp.net/Tutorials/quickstart.aspx
> >
> > for normal asp, its not complicated either:
> >

> http://msdn.microsoft.com/library/de...webcontrol.asp
> >
> > Have fun
> >
> > Remy
> >

>
>
>

 
Reply With Quote
 
Rote Rote
Guest
Posts: n/a
 
      02-09-2006
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 ***
 
Reply With Quote
 
=?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
Guest
Posts: n/a
 
      02-10-2006
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/...t_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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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 ***

>
>
>

 
Reply With Quote
 
Patrick.O.Ige
Guest
Posts: n/a
 
      02-11-2006
Thanks alot Phillip
I would try that out

"Phillip Williams" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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/...t_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" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > 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 ***

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Datagrid: how cut short display of a long description in a datagrid column Brian K. Williams ASP .Net 0 03-02-2004 08:35 PM
RE: Datagrid: how cut short display of a long description in a datagrid column =?Utf-8?B?U3VyZXNo?= ASP .Net 0 03-02-2004 08:31 PM
datagrid in datagrid BK Kim ASP .Net 1 03-02-2004 06:34 AM
Call Datagrid Command column outside datagrid Dave ASP .Net 0 11-20-2003 11:11 AM
To all Gurus: How can I edit/update a DataGrid in a DataGrid (nested DataGrid)? Possible? Andreas Klemt ASP .Net Datagrid Control 0 10-08-2003 01:19 AM



Advertisments