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

C#

 
GeneralRe: How to increase filtering speed in DataGridView? Pin
OriginalGriff31-May-21 4:43
mveOriginalGriff31-May-21 4:43 
GeneralRe: How to increase filtering speed in DataGridView? Pin
Gerry Schmitz31-May-21 7:30
mveGerry Schmitz31-May-21 7:30 
QuestionPluginLoader with GtkSharp 3.22.x Pin
Jens Eckervogt 25-May-21 23:22
Jens Eckervogt 25-May-21 23:22 
AnswerRe: PluginLoader with GtkSharp 3.22.x Pin
OriginalGriff25-May-21 23:40
mveOriginalGriff25-May-21 23:40 
QuestionMultidimensional Arrays error in fill IList Interface Pin
michael nabil21-May-21 7:57
michael nabil21-May-21 7:57 
AnswerRe: Multidimensional Arrays error in fill IList Interface Pin
Dave Kreskowiak21-May-21 8:12
mveDave Kreskowiak21-May-21 8:12 
GeneralRe: Multidimensional Arrays error in fill IList Interface Pin
michael nabil21-May-21 9:09
michael nabil21-May-21 9:09 
GeneralRe: Multidimensional Arrays error in fill IList Interface Pin
Dave Kreskowiak21-May-21 9:43
mveDave Kreskowiak21-May-21 9:43 
That's a bad way to go. Controls should NEVER be used as your storage for data.

Your CSV should be parsed to a data structure designed to hold that data. Fields can be setup to hold strings, integers, doubles, or whatever you need, and the CSV parser just places the values in the appropriate fields with no conversion. The DGV can then be used to display it if needed.

Using the DGV as your storage makes accessing that data slow because you're now doing a bunch of converting to sting or other types that you wouldn't need to do otherwise.

For example, this is garbage. You're converting a value in the DGV to a string and then parsing that string as an integer. This code will also fail if you've got no value in that cell.
C#
invoiceline.quantity = int.Parse(datavalu[i, 5].ToString());
Putting the data directly into a datastructure designed to hold it from the CSV parser is a much better way to go as you get to validate the data before you use or even display it and handle that occurrence at a more appropriate time, when it's being loaded.

GeneralRe: Multidimensional Arrays error in fill IList Interface Pin
michael nabil21-May-21 10:03
michael nabil21-May-21 10:03 
AnswerRe: Multidimensional Arrays error in fill IList Interface Pin
OriginalGriff21-May-21 8:21
mveOriginalGriff21-May-21 8:21 
GeneralRe: Multidimensional Arrays error in fill IList Interface Pin
michael nabil21-May-21 8:35
michael nabil21-May-21 8:35 
GeneralRe: Multidimensional Arrays error in fill IList Interface Pin
Richard Andrew x6421-May-21 9:06
professionalRichard Andrew x6421-May-21 9:06 
GeneralRe: Multidimensional Arrays error in fill IList Interface Pin
OriginalGriff21-May-21 9:13
mveOriginalGriff21-May-21 9:13 
GeneralRe: Multidimensional Arrays error in fill IList Interface Pin
Gerry Schmitz21-May-21 9:02
mveGerry Schmitz21-May-21 9:02 
GeneralRe: Multidimensional Arrays error in fill IList Interface Pin
michael nabil21-May-21 9:29
michael nabil21-May-21 9:29 
GeneralRe: Multidimensional Arrays error in fill IList Interface Pin
OriginalGriff21-May-21 9:56
mveOriginalGriff21-May-21 9:56 
GeneralRe: Multidimensional Arrays error in fill IList Interface Pin
michael nabil21-May-21 10:05
michael nabil21-May-21 10:05 
GeneralRe: Multidimensional Arrays error in fill IList Interface Pin
OriginalGriff21-May-21 10:31
mveOriginalGriff21-May-21 10:31 
GeneralRe: Multidimensional Arrays error in fill IList Interface Pin
michael nabil21-May-21 10:55
michael nabil21-May-21 10:55 
GeneralRe: Multidimensional Arrays error in fill IList Interface Pin
OriginalGriff21-May-21 11:38
mveOriginalGriff21-May-21 11:38 
GeneralRe: Multidimensional Arrays error in fill IList Interface Pin
michael nabil22-May-21 9:53
michael nabil22-May-21 9:53 
GeneralRe: Multidimensional Arrays error in fill IList Interface Pin
OriginalGriff22-May-21 10:01
mveOriginalGriff22-May-21 10:01 
AnswerRe: Multidimensional Arrays error in fill IList Interface Pin
Eddy Vluggen21-May-21 12:01
professionalEddy Vluggen21-May-21 12:01 
QuestionWhy dictionary puts data inside [] mark? Pin
Alex Dunlop19-May-21 20:26
Alex Dunlop19-May-21 20:26 
QuestionRe: Why dictionary puts data inside [] mark? Pin
Richard MacCutchan19-May-21 21:00
mveRichard MacCutchan19-May-21 21:00 

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.