Click here to Skip to main content
15,914,214 members
Home / Discussions / C#
   

C#

 
AnswerRe: Detecting Flash disk or Memeory stick?? Pin
Niiiissssshhhhhuuuuu26-Mar-07 3:22
Niiiissssshhhhhuuuuu26-Mar-07 3:22 
QuestionWheres my data when app.config is an Embedded Resource Pin
Christopher Stratmann26-Mar-07 1:56
Christopher Stratmann26-Mar-07 1:56 
AnswerRe: Wheres my data when app.config is an Embedded Resource Pin
Hayder Marzouk26-Mar-07 2:20
Hayder Marzouk26-Mar-07 2:20 
GeneralRe: Wheres my data when app.config is an Embedded Resource Pin
Christopher Stratmann26-Mar-07 2:25
Christopher Stratmann26-Mar-07 2:25 
QuestionScope of Refereances to Instances Pin
MehmetFurkan26-Mar-07 1:42
MehmetFurkan26-Mar-07 1:42 
AnswerRe: Scope of Refereances to Instances Pin
rah_sin26-Mar-07 1:55
professionalrah_sin26-Mar-07 1:55 
QuestionRe: Scope of Refereances to Instances Pin
MehmetFurkan26-Mar-07 4:37
MehmetFurkan26-Mar-07 4:37 
Questionget data in background for datagridview Pin
Seishin#26-Mar-07 0:53
Seishin#26-Mar-07 0:53 
Hi!
I'm using a dataGridView (dgv) bound to dataSet through bindingSource.
one method (fired by button.click) fills the dataSet using dataAdapter.
the dgv displays loaded rows.
now what my goal is: when a row is displayed additional data for it is loaded in a background thread, and the row is refreshed (i'm using grid's overriden paint event to display the additional data) the reason for this is that I want to get and display the additional data only if the row is ever displayed, to avoid downloading (from sqldb) data that is not needed..

my current solution is:
<br />
public void GetPricesForRow(DataGridViewRow row) {<br />
if(backgroundThread != null)<br />
while(backgroundThread.ThreadState == System.Threading.ThreadState.Running)<br />
Thread.Sleep(3);<br />
<br />
backgroundThread = new Thread(new ThreadStart(delegate() {<br />
try {<br />
int colCt = row.DataGridView.Columns.Count;<br />
<br />
string[] vals = GetAdditionalData(row.Cells[1].Value.ToString().Trim());<br />
row.Cells[colCt - 2].Value = vals[0];<br />
row.Cells[colCt - 1].Value = vals[1];<br />
row.Refresh();<br />
} catch { }<br />
}));<br />
<br />
backgroundThread.Start();<br />
}<br />


row.Refresh(); fires:
<br />
public void Refresh() {<br />
this.DataGridView.InvalidateRow(this.Index);<br />
}	<br />


well it works.. but pretty slow.. when i set backgroundThread.IsBackground to true the row doesn't refresh (at least not always)

anybody knows a better solution?

life is study!!!

AnswerRe: get data in background for datagridview Pin
Hayder Marzouk26-Mar-07 2:23
Hayder Marzouk26-Mar-07 2:23 
AnswerRe: get data in background for datagridview Pin
Seishin#26-Mar-07 3:03
Seishin#26-Mar-07 3:03 
Questionwonder if some one clear the confusion about Generating MS project Pin
fulbright26-Mar-07 0:41
fulbright26-Mar-07 0:41 
QuestionINTEROP PROBLEM (using dll written in c, linked list) Pin
mephy8326-Mar-07 0:32
mephy8326-Mar-07 0:32 
AnswerRe: INTEROP PROBLEM (using dll written in c, linked list) Pin
netJP12L26-Mar-07 4:14
netJP12L26-Mar-07 4:14 
AnswerRe: INTEROP PROBLEM (using dll written in c, linked list) Pin
Leslie Sanford26-Mar-07 5:24
Leslie Sanford26-Mar-07 5:24 
Questionunderlying type for enum Pin
blackjack215025-Mar-07 23:40
blackjack215025-Mar-07 23:40 
AnswerRe: underlying type for enum Pin
originSH25-Mar-07 23:48
originSH25-Mar-07 23:48 
GeneralRe: underlying type for enum Pin
blackjack215026-Mar-07 0:01
blackjack215026-Mar-07 0:01 
GeneralRe: underlying type for enum Pin
originSH26-Mar-07 2:12
originSH26-Mar-07 2:12 
AnswerRe: underlying type for enum Pin
Guffa26-Mar-07 2:18
Guffa26-Mar-07 2:18 
QuestionProblems with Console Output from Windows-App Pin
J. Holzer25-Mar-07 23:36
J. Holzer25-Mar-07 23:36 
AnswerRe: Problems with Console Output from Windows-App Pin
m@u26-Mar-07 3:39
m@u26-Mar-07 3:39 
Question.NET out of proc component exposing COM Interface Pin
abhinarulkar25-Mar-07 23:28
abhinarulkar25-Mar-07 23:28 
QuestionHow to check if one type it is .Net type Pin
darkcalin25-Mar-07 22:59
darkcalin25-Mar-07 22:59 
AnswerRe: How to check if one type it is .Net type Pin
Colin Angus Mackay25-Mar-07 23:10
Colin Angus Mackay25-Mar-07 23:10 
GeneralRe: How to check if one type it is .Net type Pin
darkcalin25-Mar-07 23:16
darkcalin25-Mar-07 23:16 

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.