Click here to Skip to main content
15,898,826 members
Home / Discussions / C#
   

C#

 
GeneralRe: Looping through Controls on a tab page Pin
Mike Dimmick17-Jul-07 11:42
Mike Dimmick17-Jul-07 11:42 
GeneralRe: Looping through Controls on a tab page Pin
PIEBALDconsult17-Jul-07 11:49
mvePIEBALDconsult17-Jul-07 11:49 
JokeRe: Looping through Controls on a tab page Pin
BoneSoft17-Jul-07 12:10
BoneSoft17-Jul-07 12:10 
GeneralRe: Looping through Controls on a tab page Pin
PIEBALDconsult17-Jul-07 14:04
mvePIEBALDconsult17-Jul-07 14:04 
GeneralRe: Looping through Controls on a tab page Pin
Mike Dimmick17-Jul-07 20:17
Mike Dimmick17-Jul-07 20:17 
GeneralRe: Looping through Controls on a tab page Pin
PIEBALDconsult18-Jul-07 8:56
mvePIEBALDconsult18-Jul-07 8:56 
AnswerRe: Looping through Controls on a tab page Pin
BoneSoft17-Jul-07 10:48
BoneSoft17-Jul-07 10:48 
QuestionSelect Records From DataGridView Pin
polishprogrammer17-Jul-07 10:08
polishprogrammer17-Jul-07 10:08 
I need to create an application where a user can select some records from a DataGridView and create a Crystal Report based on those records. I basically created most of the necessary functionality using the DataGridView.SelectedRows property to get the selected rows and then importing those rows into a data table that I use to create the report, like so:

foreach(DataGridViewRow r in this.gridView_Hydro_Results.SelectedRows)
{


int selectIndex = r.Index;
row = resultsTable.Rows[selectIndex];


dtSelectedRecords.ImportRow(row);

}


Unfortunately, when I create the report, the records are not in the order of selection. Instead, the records are in the reverse order. It seems like the rows are getting added in a last in, first out order. While that may be easy to counter, my customers actually probably don't care what order the y select the records in, but want the report ordered according to some field in the database, like time or date. I suppose I could build a method to sort the Data Table (or the collection gridview rows) after I create it, but I was wondering if there is a more elegant solution.

In the same vein, is it possible to use a generic list collection in a SQL statement. I was thinking of adding the value of the primary key for each selected row to a List<> object and then using a SELECT * FROM Table WHERE KEY IN (List<>), but am not sure if that will work.

Anyway, any advice would be appreciated. Thanks.
AnswerRe: Select Records From DataGridView Pin
Paul Conrad17-Jul-07 19:11
professionalPaul Conrad17-Jul-07 19:11 
GeneralRe: Select Records From DataGridView Pin
polishprogrammer18-Jul-07 4:11
polishprogrammer18-Jul-07 4:11 
QuestionList View Search Pin
topksharma198217-Jul-07 9:44
topksharma198217-Jul-07 9:44 
AnswerRe: List View Search Pin
BoneSoft17-Jul-07 10:14
BoneSoft17-Jul-07 10:14 
GeneralRe: List View Search Pin
topksharma198217-Jul-07 22:16
topksharma198217-Jul-07 22:16 
GeneralRe: List View Search Pin
BoneSoft18-Jul-07 1:49
BoneSoft18-Jul-07 1:49 
AnswerRe: List View Search Pin
Luis Alonso Ramos17-Jul-07 14:29
Luis Alonso Ramos17-Jul-07 14:29 
GeneralRe: List View Search Pin
topksharma198217-Jul-07 23:04
topksharma198217-Jul-07 23:04 
GeneralRe: List View Search Pin
Luis Alonso Ramos18-Jul-07 5:27
Luis Alonso Ramos18-Jul-07 5:27 
Questioncookies Pin
daku117-Jul-07 9:40
daku117-Jul-07 9:40 
AnswerRe: cookies Pin
dino209417-Jul-07 10:27
dino209417-Jul-07 10:27 
AnswerRe: cookies Pin
Dave Kreskowiak17-Jul-07 10:27
mveDave Kreskowiak17-Jul-07 10:27 
AnswerRe: cookies Pin
Ravi Bhavnani17-Jul-07 17:35
professionalRavi Bhavnani17-Jul-07 17:35 
GeneralRe: cookies Pin
daku117-Jul-07 11:53
daku117-Jul-07 11:53 
GeneralRe: cookies Pin
Dave Kreskowiak17-Jul-07 14:04
mveDave Kreskowiak17-Jul-07 14:04 
GeneralRe: cookies Pin
Paul Conrad17-Jul-07 12:32
professionalPaul Conrad17-Jul-07 12:32 
Questionany interview questions Pin
Sree Nivas17-Jul-07 9:36
Sree Nivas17-Jul-07 9:36 

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.