|
Glad you found a control that seems like it will work for you. I'm still puzzled over the large difference in times between the same test on my system and yours...
|
|
|
|
|
I'm testing this at work on a garbage PC with loads of memory hogging junk that *has* to be on here. I'll retest at home tonight on a decent machine.
The control I found has promise but needs a lot of work before I could use it in a production environment which I don't have time for right now. Thought I'd mention it anyway as the performance it provides is outstanding.
Dsve
|
|
|
|
|
The big difference was the PC. At home I'm acheiving around 250ms!
I've ammended the code as you suggested and I'm seeing similar results - using the List<> is approximately the same as not. There's occaisionally a slight difference of 30ms or so, as you found, which can go to either method but on average yours is the quicker.
I've tried it with a real world sample reading 15000 childNodes (so 30001 actual TreeNodes) from an xml file on a seperate thread and returning an object to the UI that holds the List<>, the start time and a result of the xml read operation - the UI is then updated from the List in the method you suggested and the whole thing is now completing in about 1.5 seconds.
That is quite remarkable and definately acceptable so problem solved
Many thanks once again,
Dave
|
|
|
|
|
Glad to know the speed differences were due to hardware. Those are the same results I saw, on average the solution using AddRange being faster the majority of the time.
It's good to hear that using a real sample you were able to achieve the results you wanted.
Glad to have helped.
|
|
|
|
|
I developed a treeview using backgroundworker.
My Tree have aprox. 2100 nodes, aprox. 8000 subnodes and sub-subnodes ... the rest to aprox 100.000.
Using a thread you can make the gui immediately responsive, because, usualy, you can't show more than aprox. 50 main nodes in one page.
Before using that,it took aprox 3-5 seconds (on my machine) to load.
Now is apparently instantly ... and that satisfied my needs .
So, Guys use backgroundworker to realy speed-up that f***ing Treeview from .NET.
Share knowledge !
|
|
|
|
|
dsGrid is the dataSet of gridview data.
DataTable tbl = dsGrid.Tables[0];
tbl.Rows[e.RowIndex][i].Controls[3];
When I use this, there is an error:
'object' does not contain a definition for 'Controls'. Am I missing out some reference?
Please help me on this.
Thanks
|
|
|
|
|
ss.mmm wrote: 'object' does not contain a definition for 'Controls'. Am I missing out some reference?
Nope. The DataTable Rows collections returns a DataRow object. A DataRow object does NOT have a Controls collection. The only collection a DataRow exposes is an Item array which contains the objects for each column in that row. Any data in a column is return as a System.Object. If you want to use the object in that column you have to cast it back to the original type, giving you the ability to use the object again.
|
|
|
|
|
Thanks for the information.
Thanks,
|
|
|
|
|
And don't cross post in multiple forums. It's rude and makes it very difficult for multiple people to collaborate on a solution.
|
|
|
|
|
hi ,
im currently working on a project (C#) that demends to have a minimal support of updating the current currency rates and give a minimal ability to convert from diferent curency for example
the dolar today worth 4.13 israel new shekel conversion was USD -> ILS
so i thought to my self theres probably tons of free web services which support that kind of action , but after i was googling and searching thecodeproject i found that there are only a few webservices for that matter that are free and all the servers that i have found which support these web services seems to be down ex: http://www.xmethods.com , also i found some articles in thecodeproject which present nice solutions for this problem
but none of them had currency rates for Israeli new shekel which is the main currency i need to work with or they were too complex for such a small thing
(a solution that involves registering to a daily email list of a certain site
which provide you updated currency rates , then use POP3 track the email , analize its content.....)
so im asking for your advice, which technique should i use to get updated currency rates into my program? is there any code out there for that?
are there any reliable servers that support these webservices free that you know of?
any other information regard this problem is more than welcome!
thanks
Net
|
|
|
|
|
udikantz wrote: is there any code out there for that?
Absolutely! See this[^] article.
/ravi
|
|
|
|
|
thanks for the article ,
i will play with your source and samples.
although i was thinking about something that is more specific about currencies cause i realy didnt want to spend time on coding convertors and ect....
but looks like i'll have to do something about it :P
so thanks man
"'1=1--
|
|
|
|
|
The WebResourceProvider framework is pretty powerful (and easy to use), imho. Here are a couple of real world examples that are very popular:/ravi
|
|
|
|
|
I have a table in sql that is have to be filled from a text box how it could be done
SAS
|
|
|
|
|
Use a funnel.
I do not believe they are right who say that the defects of famous men should be ignored. I think it is better that we should know them. Then, though we are conscious of having faults as glaring as theirs, we can believe that that is no hindrance to our achieving also something of their virtues. - W. Somerset Maugham
My New Blog
|
|
|
|
|
whats this i need the code
sas
|
|
|
|
|
This can be done by any of about a half dozen methods. None of which we, or anyone else, will write for you.
YOu've got a bunch of research to do. Here...start reading[^].
|
|
|
|
|
I am pretty new to C#, but have done OO programming for a long time. According to the docs, the function I am calling ( IWebBrowser2.Refresh() ) includes "S_OK" as one of its return codes. This is a new one to me, as I am used to numerical or boolean return codes, but not this.
Anyway, I attempted (and failed ) at
<br />
<br />
while (webBrowser.Refresh() == S_OK )<br />
{<br />
System.Threading.Thread.Sleep(refreshInterval * 1000);<br />
<br />
}<br />
But I get the error message "The name 'S_OK' does not exist in the current context" . So, how do I get it to exist?
Thank You.
John Gooch
|
|
|
|
|
Try this:
VSConstants.S_OK
|
|
|
|
|
S_OK is a constant defined in the C++ header files in the Platform SDK. It IS a numerical return code. It's defined in the WinError.h file as:
#define S_OK ((HRESULT)0x00000000L)
which translates, in your code, to 0.
|
|
|
|
|
Alright. 0 will work, but I would think that I could include a file or reference that has all of the standard constants defined. So, using Microsoft Visual Studio 2005 Professional Edition, and knowing that I am programming in C#, how would I include the reference that contains these constants?
John Gooch
|
|
|
|
|
You don't. You rewrite them.
All of the constants in the Platform SDK are contained in about 700+ header files. In a C++ app, you start the process of importing a good chunk of them with #include <windows.h> , which has #includes for more, and those have includes, for more, ... But, those #include statements only work in a C++ compiler, not C#.
You cannot use C/C++ code in a C# app.
|
|
|
|
|
Hi,
I'm very new to C# and .NET so sorry if this question sounds really stupid, but how could I get a handle (or pointer) to a brush object in C#.
I'm trying to use gdi32.dll's FrameRgn to add a frame to an irregular borderless form. One of the parameters to the method is a brush handle. I've googled this but I could only see VB.NET examples of codes using FrameRgn.
Thanks to anyone who can help.
|
|
|
|
|
You do exactly as they do in VB.NET. The entire framework is the same, it's just the language syntax that differs.
---
single minded; short sighted; long gone;
|
|
|
|
|
Ha ha ha... I read your response before having breakfast
I should have clarified my question:
The VB example I saw has this line:
Dim hBrush As Long
hBrush = CreateHatchBrush(HS_DIAGCROSS, RGB(0, 255, 0))
I could not find CreateAnyTypeOfBrush in the VS HelpIndex nor the Object Browser. Which namespace/dll/assembly does this method belong to? Or should I use a similar/different method in C#. The website I saw the above example from tells you to buy a book to get more info on the above example.
I already inserted System.Runtime.InteropServices in my using statements (based on another website I saw).
I could not translate the above code to C#. I already have been able to import the FrameRgn method from gdi32.dll, but I'm stuck with the above line of code. Please help, anybody. Thanks very much
-- modified at 21:55 Thursday 20th September, 2007
|
|
|
|