Click here to Skip to main content
15,909,437 members
Home / Discussions / C#
   

C#

 
AnswerRe: Issues with using C# library in Excel 2007 VBA Pin
TnTinMn6-Jan-14 12:03
TnTinMn6-Jan-14 12:03 
Questionwpf prompbox Pin
Member 93270026-Jan-14 3:40
Member 93270026-Jan-14 3:40 
AnswerRe: wpf prompbox Pin
Pete O'Hanlon6-Jan-14 3:59
mvePete O'Hanlon6-Jan-14 3:59 
QuestionPopulate a DVG from a csv file Pin
JOHNNYDEMICHAEL5-Jan-14 7:45
JOHNNYDEMICHAEL5-Jan-14 7:45 
AnswerRe: Populate a DVG from a csv file Pin
Dave Kreskowiak5-Jan-14 8:27
mveDave Kreskowiak5-Jan-14 8:27 
GeneralRe: Populate a DVG from a csv file Pin
JOHNNYDEMICHAEL5-Jan-14 12:13
JOHNNYDEMICHAEL5-Jan-14 12:13 
GeneralRe: Populate a DVG from a csv file Pin
Dave Kreskowiak5-Jan-14 12:24
mveDave Kreskowiak5-Jan-14 12:24 
GeneralRe: Populate a DVG from a csv file Pin
JOHNNYDEMICHAEL8-Jan-14 0:58
JOHNNYDEMICHAEL8-Jan-14 0:58 
Thanks for your input.
OK . . I have parsed the lines, adding them to a DataTable. I then bound to my DGV.

The time to populate the dgv decreased from 120 sec to 15 sec . . . nice improvement.

My program interacts with other DGVs and it is necessary to add rows to my DGV. Note that the program worked without using a DataTable, but was slow populating the data from the CSV file to the DGV. I have no problem with speed issues on other functions . . adding rows directly to the DGV, sorting, etc.

Now after using a DataTable as a data source for the DGV (only for populating the DGV) I get an error when other functions run to add rows to the DGV. I understand I could just work thru the bound DataTable, but I would prefer not. After I bound the data table to the dgv . . .

DataGridView1.DataSource = csvData; //csvData is DataTable

But when functions try to run that add rows to dgv,

DataGridView1.Rows.Add();

I get the error . . .

Rows cannot be programmatically added to the DataGridView's rows collection when the control is data-bound.

So I would like to use the datatable only to initially populate the dgv and then UNBIND, allowing the program to run as it did before, having resolved the speed issue in populating.

I have used the following attempting to unbind, but still get the same error above.

DataGridView1.DataBindings.Clear();

DataGridView1.Columns.Clear(); //NO . . this deletes ALL rows.

DataGridView1.DataSource.Equals(null);

Any suggestions would be appreciated.

John
GeneralRe: Populate a DVG from a csv file Pin
Dave Kreskowiak8-Jan-14 2:53
mveDave Kreskowiak8-Jan-14 2:53 
GeneralRe: Populate a DVG from a csv file Pin
JOHNNYDEMICHAEL9-Jan-14 2:28
JOHNNYDEMICHAEL9-Jan-14 2:28 
GeneralRe: Populate a DVG from a csv file Pin
Dave Kreskowiak9-Jan-14 4:25
mveDave Kreskowiak9-Jan-14 4:25 
AnswerRe: Populate a DVG from a csv file Pin
OriginalGriff5-Jan-14 23:03
mveOriginalGriff5-Jan-14 23:03 
AnswerRe: Populate a DVG from a csv file Pin
Eddy Vluggen6-Jan-14 8:13
professionalEddy Vluggen6-Jan-14 8:13 
QuestionReading values from window-form to XNA Pin
larsp7775-Jan-14 0:42
larsp7775-Jan-14 0:42 
AnswerRe: Reading values from window-form to XNA Pin
Ron Beyer5-Jan-14 17:52
professionalRon Beyer5-Jan-14 17:52 
GeneralRe: Reading values from window-form to XNA Pin
larsp7775-Jan-14 22:09
larsp7775-Jan-14 22:09 
GeneralRe: Reading values from window-form to XNA Pin
Ron Beyer6-Jan-14 7:44
professionalRon Beyer6-Jan-14 7:44 
GeneralRe: Reading values from window-form to XNA Pin
larsp7776-Jan-14 8:24
larsp7776-Jan-14 8:24 
GeneralRe: Reading values from window-form to XNA Pin
larsp7773-Feb-14 22:00
larsp7773-Feb-14 22:00 
Questionhow i can auto searching devices and sending file with bluetooth using 32feet ,C#,WPf Pin
h.k_net4-Jan-14 21:32
h.k_net4-Jan-14 21:32 
AnswerRe: how i can auto searching devices and sending file with bluetooth using 32feet ,C#,WPf Pin
Kornfeld Eliyahu Peter4-Jan-14 22:29
professionalKornfeld Eliyahu Peter4-Jan-14 22:29 
QuestionCreating C# TCP listener windows Service Pin
Tobben_4-Jan-14 11:47
Tobben_4-Jan-14 11:47 
AnswerRe: Creating C# TCP listener windows Service PinPopular
Ron Beyer4-Jan-14 12:00
professionalRon Beyer4-Jan-14 12:00 
QuestionGetting Thread Exception: while using System.Timer Class Pin
Member 99612394-Jan-14 7:16
Member 99612394-Jan-14 7:16 
AnswerRe: Getting Thread Exception: while using System.Timer Class Pin
Pete O'Hanlon4-Jan-14 8:15
mvePete O'Hanlon4-Jan-14 8:15 

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.