By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,892 Members | 1,343 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,892 IT Pros & Developers. It's quick & easy.

Sorting by columns capability

P: n/a
I am creating a table cell by cell (create the table, add columns, create
row, add cells to the row) in which I want to add the capability for users
to sort ASC and DESC by column header.

Can anyone give me an idea or an example of how can I do this in code ?

Thank you.

Dan

Jul 1 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
You need to provide more details about the table you are using. Is it web or
windows and what control is showing the table in the UI. There will normally
be an easy way for the control to do this but its different for each control.

Let us know more so we can help you.
--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"Dan Grigore" wrote:
I am creating a table cell by cell (create the table, add columns, create
row, add cells to the row) in which I want to add the capability for users
to sort ASC and DESC by column header.

Can anyone give me an idea or an example of how can I do this in code ?

Thank you.

Dan

Jul 1 '08 #2

P: n/a
Ciaran,

Thank you for your help.

I have to update the work of somebody else :) and that's why I am trying to
figure out what he has done here.

It is a web form and the in the table a create a headerrow with header
cells.

The table is updated depending on two dropdown menus situated on top of the
webpage.

I am trying to search for a gridview he created but the only thing i see is
a <asp:tablein the aspx file (not a gridview or something which could help
me use the sort property).

The file.asp.cs is creating the header row,the header cells, and it creates
each row, one by one.

Is there any easy way of doing this?

Thank you.

"Ciaran O''Donnell" wrote:
You need to provide more details about the table you are using. Is it web or
windows and what control is showing the table in the UI. There will normally
be an easy way for the control to do this but its different for each control.

Let us know more so we can help you.
--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"Dan Grigore" wrote:
I am creating a table cell by cell (create the table, add columns, create
row, add cells to the row) in which I want to add the capability for users
to sort ASC and DESC by column header.

Can anyone give me an idea or an example of how can I do this in code ?

Thank you.

Dan
Jul 1 '08 #3

P: n/a
sounds like you are dynamically generating TableRow and TableCell
elements,

ok so assuming you are using a DataSet the original coder could be
either 1) sorting in the DB or 2) using something like
myDataSet.Table[0].Select() to do the sorting

UNLESS

(s)he has written some nice client side javascript.
Jul 2 '08 #4

P: n/a
Densial,

The table is dynamically generated with TableRow and TableCell.

More inthe aspx file, I have a asp:table not an asp:gridview.

If I would like to use javascript, is it possible to add thead or tbody to
the asp:table control? Or is there some other way to control the header cell?

If using the <asp:tablecontrol is it possible to control the columns to
add sorting?

Thank you.

Dan

"densial" wrote:
sounds like you are dynamically generating TableRow and TableCell
elements,

ok so assuming you are using a DataSet the original coder could be
either 1) sorting in the DB or 2) using something like
myDataSet.Table[0].Select() to do the sorting

UNLESS

(s)he has written some nice client side javascript.
Jul 2 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.