|
Hi,
I have an DataGridView with total of 14 columns. Two of those columns are Images.
The application is supposed to run 24/7. The grid is constantly refreshed from background worker with new data.
New rows are added programatically into datatable which is datasource of binding source that is grid data source. Also, periodically (approx. every 30 min.) whole table is refreshed with query from SQL server.
After approximately more than 12 hrs of non stop working the grid slows down as I have more than 100.000 records displayed.
I have found that when its slows down, I just hide the image columns, the grid starts to act normaly, but then when I return those columns visible status to true, everything slows down again.
I have tried everything. Bounded images from datasource, images from cell formating event, virtual mode, really everything.
Any ideas?
Thanks in advance.
damir@iit.com.hr
|
|
|
|
|
Hi,
DataGridView is a ... . I have suffered something similar. I tried to load a 33000 rows datatable and it were to slow loading.
My solution (and maybe yours) is create a new user control (datagridview with buttons to scroll up/down one by one and by one page) that envolves the datagrid but I have implemented my own datasource. When I set a dataset as a datasource, the control segments the datatable to load only the rows that I can see (10-15). Then, when I scroll down it loads the next group of rows.
It works good and is not very difficult. And the load and the scroll time have been reduced. Good luck!
|
|
|
|
|
Thanks for your answer,
I've allready tought about such solution and I like it. But the problem is not in the number of records. The problem is with image columns.
Yesterday I have tried my last desperate atempt to solve the problem and it works.
Here is what I have done:
When datatable refresh background worker executes (approx. every 4 seconds), then I execute the following code also (but not allways, let say every 60 min.):
int index = this.dispatchstatusImageAllCol.Index;
int displayindex = this.dispatchstatusImageAllCol.DisplayIndex;
bool visible = this.dispatchstatusImageAllCol.Visible;
int width = this.dispatchstatusImageAllCol.Width;
string name = this.dispatchstatusImageAllCol.Name;
string hdr = this.dispatchstatusImageAllCol.HeaderText;
this.gridAll.Columns.Remove(this.dispatchstatusImageAllCol);
this.dispatchstatusImageAllCol = new DataGridViewImageColumn(); // 1. most important line
this.dispatchstatusImageAllCol.DisplayIndex = displayindex;
this.dispatchstatusImageAllCol.Visible = visible;
this.dispatchstatusImageAllCol.Width = width;
this.dispatchstatusImageAllCol.ContextMenuStrip = this.gridAllMenuStrip;
this.dispatchstatusImageAllCol.HeaderText = "";
this.dispatchstatusImageAllCol.Name = name;
this.dispatchstatusImageAllCol.ReadOnly = true;
this.dispatchstatusImageAllCol.Resizable = DataGridViewTriState.True;
this.dispatchstatusImageAllCol.HeaderText = hdr;
this.gridAll.Columns.Insert(index, this.dispatchstatusImageAllCol); // 2. important line
This is probably the proof that there is a memory management problem with DataGridViewImageColumn.
|
|
|
|
|
Can u provide me with an example of a date routine that will return the begin and ending period for a week number. For example, if week 14 for 2007 was provided, the routine would return starting date 08/04/2007 and ending week 14/04/2007.
Input Provided - week number (1 - 53), and Year(cccc)
Output - week begin date and week end date
Revathi Raj
|
|
|
|
|
private void getDateRange(int weekNumber, int year, out DateTime dt1, out DateTime dt2)
{
DateTime dt = new DateTime(year, 1, 1);
//get inside week number 'weekNumber'
dt = dt.AddDays(7 * (weekNumber - 1));
//get first day of the week
dt = dt.AddDays(-(int)dt.DayOfWeek);
dt1 = dt;
//get last day of the week
dt2 = dt.AddDays(6);
}
//call it like this
DateTime dt1;
DateTime dt2;
getDateRange(26, 2007, out dt1, out dt2);
|
|
|
|
|
I wouldn't do somebody elses homework, if he not even tried to do it himselfe!
|
|
|
|
|
Revathi Raj wrote per e-mail: hi...
if u know the answer reply otherwise no need plz dont put the answer answer like this..
Revathi Raj
Hello,
1) I didn't responded to your question, I voted "1" for it!
2) Please don't spam my mail account, if you have something interesting to tell, everybody should benefit.
3) Again, I will not do your homework, at least not if you pay for it!
All the best,
MArtin
|
|
|
|
|
What i tried is using of function given below.
but problem is this that it inserted the bullet symbol of round circle, but exacly what i need is "-" this in place of that round circle.
myWordApp.Selection.Range.ListFormat.ApplyBulletDefaultOld();
Hello Forum
Always be in touch to help about the topic ASP.NET
|
|
|
|
|
This is slightly tricky requirement, Let me try to crack it Ok. In the mean time if you get some solution then let me know.
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
http://jaiprakash.blog.com/
|
|
|
|
|
What you have tried?
did it shows any error?
Regards,
Satips.
|
|
|
|
|
What i tried is using of function given below.
but problem is this that it inserted the bullet symbol of round circle, but exacly what i need is "-" this in place of that round circle.
myWordApp.Selection.Range.ListFormat.ApplyBulletDefaultOld();
Hello Forum
Always be in touch to help about the topic ASP.NET
|
|
|
|
|
hi,
i am using datetimepicker and set the custom property to HH:mm:ss and i am gettin too.
now my question is whenever i enter the hours, the cursor should point to minute and same as if i enter minute cursor should point to second. automatically
how can i do tht
help me pls
WithRegards
prasad
-- modified at 4:13 Friday 13th April, 2007
|
|
|
|
|
hi
I want to insert data directly in datagirdview and i want validation on cell when i leave cell .
thanks
|
|
|
|
|
Try Like this
public class custDataGrid:DataGrid<br />
<br />
{<br />
<br />
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)<br />
<br />
{<br />
<br />
if(msg.WParam.ToInt32() == (int) Keys.Enter)<br />
<br />
{<br />
<br />
if( this.CurrentCell.ColumnNumber == 1 )<br />
<br />
{<br />
<br />
string userid = this[this.CurrentRowIndex,0].ToString();<br />
<br />
string passwd = this[this.CurrentRowIndex,1].ToString();<br />
<br />
<br />
<br />
<br />
}<br />
<br />
SendKeys.Send("{Tab}");<br />
<br />
return true;<br />
<br />
}<br />
<br />
return base.ProcessCmdKey (ref msg, keyData);<br />
<br />
}<br />
<br />
<br />
<br />
}<br />
<br />
Regards,
Satips.
|
|
|
|
|
hi
i wont to know how to statubar
especially accordingly to my download how can i change my statubar or progressbar value
please help me if u have any articles...
bye bye
|
|
|
|
|
|
Hi,
The following code snippet can help you.
progressBar1.Maximum = 100;
progressBar1.Minimum = 0;
for(int i=0;i<100000;i++)
{
progressBar1.Value = (100*i)/100000;
}
Set the Maximum, Minimum and Value property of the progress bar based on the progress of your operation
Regards,
Murali
|
|
|
|
|
When I use this code
Process myProc;
myProc=Process.Start("notepad", "d:\\myText.txt");
myProc.Close();
there are several instances of the myText.txt open, I just need one.
thanx in advanced
|
|
|
|
|
picasso2 wrote: there are several instances of the myText.txt open, I just need one
Works like a charm for me. Are you saying there are multiple instances of Notepad open, all having opened myText.txt?
Cheers,
Vikram.
"But nowadays, it means nothing. Features are never frozen, development keeps happening, bugs never get fixed, and documentation is something you might find on wikipedia."
- Marc Clifton on betas. Join the CP group at NationStates. Password: byalmightybob
|
|
|
|
|
Count how many instances are open. Now, that's how many times this code has been executed.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Try this
Process myProc = new Process();
myProc = Process.Start(@"C:\Test.txt");
myProc.Close();
I hope this will work.
|
|
|
|
|
bhavik,
It is just a button so when it is clicked, the code is executed.
private void btnEdit_Click(object sender, EventArgs e)
{
Process myProc = new Process();
myProc = Process.Start(@"test.txt");
myProc.Close();
}
still opens more then one instance
|
|
|
|
|
Set a breakpoint. The only *possible* explanation is that it's running more than once.
Process.Start(@"test.txt");
should be all you need to just run it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I have a cystalreport connect with three storeproceduce (sp_name1, sp_name2,sp_name3, username='sa', server='m', database='a'). At my computer was connect 'ok', but if change server='alice' is print report error 'Failed to open a rowset'.
Help me! Thank you very much.
nguyen kiem
|
|
|
|
|
You have to review / check all the fields in your crystalreport file, see to it that all FIELDS you use should be the same as the one in your database. After that click the "verify database" to update you C.R. File. Message will appear "database updated".
Everytime you update the tables that you use in your crystal report you should always "click" update database in your CR file otherwise all the updates in your table will not be reflected in your C.R.
I always encouter that problem when I'm in hurry. Try it and everything will be ok.
Regards,
Satips.
|
|
|
|