Click here to Skip to main content
15,887,746 members
Home / Discussions / C#
   

C#

 
GeneralRe: Combobox Tag Pin
Mohamad Al Husseiny1-Sep-05 8:16
Mohamad Al Husseiny1-Sep-05 8:16 
QuestionCurves and Angles Pin
suresh sahu1-Sep-05 1:22
suresh sahu1-Sep-05 1:22 
AnswerRe: Curves and Angles Pin
Andrew Kirillov1-Sep-05 3:09
Andrew Kirillov1-Sep-05 3:09 
GeneralRe: Curves and Angles Pin
Nageshwar Rao1-Sep-05 5:56
Nageshwar Rao1-Sep-05 5:56 
GeneralRe: Curves and Angles Pin
Anonymous1-Sep-05 5:56
Anonymous1-Sep-05 5:56 
QuestionInterbase databse Pin
Virendrak1-Sep-05 1:02
Virendrak1-Sep-05 1:02 
QuestionProblem in Viewing data from DataGrid Pin
Dhruvesh Brahmbhatt1-Sep-05 0:44
Dhruvesh Brahmbhatt1-Sep-05 0:44 
QuestionSorting a DataView by an int[] list Pin
thomasa31-Aug-05 21:52
thomasa31-Aug-05 21:52 
I have a DataView (dvUnsorted) and I want to sort it by the values in an integerlist(iSortedList), witch responds with the values in the Column "itemID" in dvUsorted.

My idëe is to create a new Column (colSort), and ad the apropiaded value of the items index
in that cell.
So if I have a int[] list = {4,2,66,7}
My dvUnsorted will look someting like this

itemID col1 col2
66 ..
2 ...
7 ..
4 ..

dvUnsorted with the added column "colSort" will lock something like this.

itemID col1 col2 colSort
66 .. 3
2 ... 2
7 .. 4
4 .. 1

and then I youst sort the dvUnsorted by
dvUnsorted.Sort = "colSort ASC";

My code locks something like this
<br />
private DataView dvSortedItems(int[] iSortedList, DataView dvUnsorted)<br />
{<br />
	dvUnsorted.Table.Columns.Add("colSort");<br />
	for(int i = 0; i < iSortedList.Length; i++)<br />
	{<br />
                // Here I need to find the row where "itemID" = iSortedList[i]<br />
                // and add the index number to the "colSort" cell			<br />
	}<br />
        dvUnsorted.Sort = "colSort ASC";<br />
	return dvUnsorted;<br />
} <br />


So what I need is to find the row where "itemID" = iSortedList[i]
How Can I find that row in the DataList?

If theres someone with a better idëe to sort a DataView by an int[], I would be happy to know.


Thanks
Thomas
AnswerRe: Sorting a DataView by an int[] list Pin
thomasa31-Aug-05 22:51
thomasa31-Aug-05 22:51 
QuestionMS Word add-in install problem Pin
parviz_rashidi31-Aug-05 21:17
parviz_rashidi31-Aug-05 21:17 
QuestionHow can I link a listbox to a picturebox in C#.net?please help... Pin
azizkhani31-Aug-05 20:41
azizkhani31-Aug-05 20:41 
QuestionPlease help.. Pin
KORCARI31-Aug-05 19:30
KORCARI31-Aug-05 19:30 
AnswerRe: Please help.. Pin
Stefan Troschuetz31-Aug-05 21:11
Stefan Troschuetz31-Aug-05 21:11 
QuestionAudio streaming Pin
Cheezo31-Aug-05 17:33
Cheezo31-Aug-05 17:33 
QuestionRead URL Link from Managed Code? Pin
ehollar31-Aug-05 15:24
ehollar31-Aug-05 15:24 
QuestionVisual Studio Designer Pin
Eric Lacroix31-Aug-05 13:55
Eric Lacroix31-Aug-05 13:55 
QuestionInputBox Pin
kenexcelon31-Aug-05 13:42
kenexcelon31-Aug-05 13:42 
AnswerRe: InputBox Pin
Werdna31-Aug-05 13:46
Werdna31-Aug-05 13:46 
AnswerRe: InputBox Pin
kenexcelon31-Aug-05 14:21
kenexcelon31-Aug-05 14:21 
QuestionHow can I call static method using late binding Pin
Johny Ng31-Aug-05 12:50
Johny Ng31-Aug-05 12:50 
AnswerRe: How can I call static method using late binding Pin
Werdna31-Aug-05 13:43
Werdna31-Aug-05 13:43 
QuestionAssemblies References Pin
Heinz_31-Aug-05 12:47
Heinz_31-Aug-05 12:47 
AnswerRe: Assemblies References Pin
Lars Niedziolka31-Aug-05 14:07
Lars Niedziolka31-Aug-05 14:07 
AnswerRe: Assemblies References Pin
Stefan Troschuetz31-Aug-05 21:24
Stefan Troschuetz31-Aug-05 21:24 
QuestionFrame Capturing From AVI Movie Pin
Nabeel Younus Khan31-Aug-05 10:58
Nabeel Younus Khan31-Aug-05 10:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.