Click here to Skip to main content
15,886,714 members
Home / Discussions / C#
   

C#

 
QuestionPassing Window Form Controls as method argument Pin
abhinish25-Apr-06 3:28
abhinish25-Apr-06 3:28 
AnswerRe: Passing Window Form Controls as method argument Pin
Le centriste25-Apr-06 3:41
Le centriste25-Apr-06 3:41 
AnswerRe: Passing Window Form Controls as method argument Pin
Paul Brower25-Apr-06 5:03
Paul Brower25-Apr-06 5:03 
QuestionCapturing Browser data in Windows Application Pin
nw.knowledge25-Apr-06 3:09
nw.knowledge25-Apr-06 3:09 
AnswerRe: Capturing Browser data in Windows Application Pin
J4amieC25-Apr-06 3:29
J4amieC25-Apr-06 3:29 
QuestionRe: Capturing Browser data in Windows Application Pin
nw.knowledge25-Apr-06 19:58
nw.knowledge25-Apr-06 19:58 
QuestionDatagrid TextBox becomes dropdownlist on Edit/Update Pin
cppdotnet25-Apr-06 2:55
cppdotnet25-Apr-06 2:55 
QuestionProblem with deleting a row from a sorted DataGrid Pin
Larantz25-Apr-06 2:30
Larantz25-Apr-06 2:30 
Hi.

I was wondering if anyone has a solution to my problem.

I'm currently working with an application that consists of a Datagrid containing files
and filedata. As long as I don't sort the table, using columnheaders, retrieving the
selectedindex and deleting it from the DataTable is of no problem.

But when I sort the DataGrid my indexes become like this:

Before sorting: => After sorting on i.e. column "Fileset":
------------------------------------------------------------------------------------------
[Grid/Table index 0] File1.txt FilesetB => [Gridindex 0][Tableindex 3] File4.txt FilsetA
[Grid/Table index 1] File2.txt FilesetC => [Gridindex 1][Tableindex 0] File1.txt FilsetB
[Grid/Table index 2] File3.txt FilesetC => [Gridindex 2][Tableindex 4] File5.txt FilsetB
[Grid/Table index 3] File4.txt FilesetA => [Gridindex 3][Tableindex 1] File2.txt FilsetC
[Grid/Table index 4] File5.txt FilesetB => [Gridindex 4][Tableindex 2] File3.txt FilsetC

If I highlight File3.txt after sorting, I retrieve DataGrid index 4, but index 4 in the DataTable equals File5.txt, and this file is deleted instead.

Is there a way of either retrieving data from the grid that I can search for in table for deletion,
or sorting the table to match indexes with the grid, or lastly synchronize the grid and the table?

I'm kinda new to DataGrids and the only way I know of getting data is through DataSets.

I'd really appreciate some feedback Smile | :)

Best regards!

-Larantz-

-- modified at 8:34 Tuesday 25th April, 2006
AnswerRe: Problem with deleting a row from a sorted DataGrid Pin
Robert Rohde25-Apr-06 3:29
Robert Rohde25-Apr-06 3:29 
QuestionChange active database in runtime Pin
siliconesoul25-Apr-06 2:29
siliconesoul25-Apr-06 2:29 
AnswerRe: Change active database in runtime Pin
Le centriste25-Apr-06 3:43
Le centriste25-Apr-06 3:43 
GeneralRe: Change active database in runtime Pin
siliconesoul25-Apr-06 8:19
siliconesoul25-Apr-06 8:19 
GeneralRe: Change active database in runtime Pin
Le centriste25-Apr-06 9:13
Le centriste25-Apr-06 9:13 
Questionimage rotation with link Pin
Amalarajan25-Apr-06 2:20
Amalarajan25-Apr-06 2:20 
QuestionDelegate .Invoke method problem Pin
danchester25-Apr-06 2:14
danchester25-Apr-06 2:14 
Questionintegration Collection Pin
ashishnagar125-Apr-06 2:04
ashishnagar125-Apr-06 2:04 
QuestionGenerate rdlc file dynamically Pin
Bobby88725-Apr-06 1:29
Bobby88725-Apr-06 1:29 
QuestionSystem tray icon Pin
VanEtienne25-Apr-06 1:27
VanEtienne25-Apr-06 1:27 
AnswerRe: System tray icon Pin
CWIZO25-Apr-06 2:30
CWIZO25-Apr-06 2:30 
AnswerRe: System tray icon Pin
Aaron Dilliard25-Apr-06 3:57
Aaron Dilliard25-Apr-06 3:57 
AnswerRe: System tray icon Pin
Graham Nimbley25-Apr-06 9:39
Graham Nimbley25-Apr-06 9:39 
QuestionWindows based Querry Pin
meer_Lx25-Apr-06 1:24
meer_Lx25-Apr-06 1:24 
AnswerRe: Windows based Querry Pin
Guffa25-Apr-06 1:30
Guffa25-Apr-06 1:30 
GeneralRe: Windows based Querry Pin
meer_Lx25-Apr-06 20:24
meer_Lx25-Apr-06 20:24 
AnswerRe: Windows based Querry Pin
Guffa26-Apr-06 1:52
Guffa26-Apr-06 1:52 

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.