DataRow

N

Nabeel Moeen

hello all,
are the datarow index mantained when DataTable is sorted by clicking on the
column header?
that is .. if the first row is index 1, suppose, and after sorting ona
specific column this row ends up 3rd... is the index still 1?

and also .. how can i get the index of a particular datarow .. ( assuming i
hav the dataRow object) ?
 
N

Nabeel Moeen

nopes...
still waiting for a suggestion!


Alvin Bruney said:
Your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
Nabeel Moeen said:
hello all,
are the datarow index mantained when DataTable is sorted by clicking on the
column header?
that is .. if the first row is index 1, suppose, and after sorting ona
specific column this row ends up 3rd... is the index still 1?

and also .. how can i get the index of a particular datarow .. (
assuming
i
hav the dataRow object) ?
 
A

Alvin Bruney [MVP]

is the index still 1?
no

If you are at that particular row, the index is the same as the row count
ds.Tables[0].Rows[index_or_current_row_number][col].ToString()

hth

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
Nabeel Moeen said:
nopes...
still waiting for a suggestion!


Alvin Bruney said:
Your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
Nabeel Moeen said:
hello all,
are the datarow index mantained when DataTable is sorted by clicking
on
the
column header?
that is .. if the first row is index 1, suppose, and after sorting ona
specific column this row ends up 3rd... is the index still 1?

and also .. how can i get the index of a particular datarow .. (
assuming
i
hav the dataRow object) ?
 
N

Nabeel Moeen

but the index does not change when the sorting order of hte rows change by
clicking on the column header ..
the row with index 1 might end up being the third row on the grid?

Alvin Bruney said:
is the index still 1?
no

If you are at that particular row, the index is the same as the row count
ds.Tables[0].Rows[index_or_current_row_number][col].ToString()

hth

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
Nabeel Moeen said:
nopes...
still waiting for a suggestion!


Alvin Bruney said:
Your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
hello all,
are the datarow index mantained when DataTable is sorted by clicking on
the
column header?
that is .. if the first row is index 1, suppose, and after sorting ona
specific column this row ends up 3rd... is the index still 1?

and also .. how can i get the index of a particular datarow .. ( assuming
i
hav the dataRow object) ?
 
A

Alvin Bruney [MVP]

Are you sorting thru the dataview, if so that would be the reason since the
dataview is only a window into the data. If not, i will need to take a
closer look.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
Nabeel Moeen said:
but the index does not change when the sorting order of hte rows change by
clicking on the column header ..
the row with index 1 might end up being the third row on the grid?

Alvin Bruney said:
is the index still 1?
no
and also .. how can i get the index of a particular datarow .. ( assuming
i
hav the dataRow object) ?

If you are at that particular row, the index is the same as the row count
ds.Tables[0].Rows[index_or_current_row_number][col].ToString()

hth

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
Nabeel Moeen said:
nopes...
still waiting for a suggestion!


"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
Your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
hello all,
are the datarow index mantained when DataTable is sorted by
clicking
on
the
column header?
that is .. if the first row is index 1, suppose, and after sorting ona
specific column this row ends up 3rd... is the index still 1?

and also .. how can i get the index of a particular datarow .. (
assuming
i
hav the dataRow object) ?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top