|
I tried to emphasize that Collection (1) had the "original" objects; i.e. the first and only "instances".
The item sources for views (2) and (3) contain "references" to the objects in (1); so, there is no "duplication" of objects; e.g.
object o1 = new object();
object o2 = o1;
object o3 = o1;
As illustrated above, there is only one object "instance"; 02 and 03 are "references" to the original object (much as I'm suggesting the way the views should operate); with collection (1) driving the changes to the views' items collections via OnCollectionChanged.
If you are saying, you don't want to maintain "additional references" that is another matter; but that is not the same as "copying" (i.e. "cloning") objects.
(And anytime there is a List control bound to any collection, there is an implicit loading of "references" into the control from the data source).
In any event, due to the hierarchical nature of the Tree View versus a "flat" list it is pretty hard to come up with a "single" data source that can handle both at the same time.
|
|
|
|
|
Yeah, I understand. The code in my previous response "works" and is "a single collection" IMO since its just a matter of enumerating through in a specific way (FlatView). The only problem as I mentioned was that the FlatView didn't put out collection change notifications. I gave up and changed FlatView to an ObservableCollection and now the collection changes work. I guess I was imagining something magical like CollectionView / CollectionViewSource where its a "view" of the collection in a different way without building a second collection. Guess you can't do something like that.
|
|
|
|
|
I am new to ASP.Net Please.
i want to develop question answer view in codeproject forum like (accordion like onclick Expand details and again collapse)in step like.
Regards,
Pappu
|
|
|
|
|
Firoz(Pappu) wrote: I am new to ASP.Net Then your question would be better in the ASP.NET forum[^].
Firoz(Pappu) wrote: i want to develop Fine, but if you want help you need to give a bit more detail about your actual problem.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Thanks For Reply,
same view like view question posted and reply's and showing tree like structure, on click expanding details of question/reply's. in codeproject forum.
regards,
Firoz
|
|
|
|
|
That's not a question either. That's a vague statement of a requirement that looks like you hope someone will give you code.
|
|
|
|
|
Hi,
please see link forum view which contains onclick it expands and other will collapse and if click on other one will expand and expanded question/reply will collapse same like view.
for example.
question
Re: Reply1
Re: Re:Reply For Rely
|
|
|
|
|
But what code do you already have in place? And as a hint - CodeProject expands things at the client side, so it uses JavaScript not C# to do this.
|
|
|
|
|
Please check below link.
<a href="http://api.jquery.com/toggle/">http://api.jquery.com/toggle/</a>[<a href="http://api.jquery.com/toggle/" target="_blank" title="New Window">^</a>]
This will help you to implement at client side.
|
|
|
|
|
|
hello,
I am creating a data visualization tool using C# and Javascript. I have embedded a webbrowser control in a C# winform application and have written a javascript code for it.
My problem is i need to pass a value from javascript to C#. I am successfully able to pass value from C# to Javascript but not vice-versa.
my javascript code is
google.maps.event.addListener(marker, 'dragend', function(ev){
var newpos= marker.getPosition();
});
i want to pass value of newpos to C# so that i can use it for further computation
please help me for this.
|
|
|
|
|
yes, it can be a bitch. What you can do is add a server control (label, textbox, ...) and hide it. You can assign a clientid to that control. That client id is known by javascript. In fact, you can just assign it a server id and load the page. If you search the control in your webpage source you'll find that .net created a client id for you (mostly the server id with an autogenerated suffix like c001 or something).
hope this helps.
|
|
|
|
|
I am using WCF services with Thread Pool concepts in the application using Oracle Database. The application has a Scheduling Workflow, where there will be multiple Jobs scheduled at the same time. The expected behavior is that, once the scheduler is triggered, all the jobs should be started parallel and at the background, various process are run.
All the jobs are not started in parallel. Say for example, if there are 20 jobs scheduled, only 15 are getting started and remaining are struck.
It results in Oracle Connection request timed out error.
Options Tried:
As the application uses PerSession and Concurrency mode as Multiple. Tried this could have been a WCF Throttling issues. So modified the Throttling parameters as well. But still results in Oracle error.
Any help would be appreciated.
|
|
|
|
|
pls help wiht this code
int intOrder = int.Parse(frmInput.InvoiceOrder);
byte[] photo_aray;
OleDbDataAdapter adapter = new OleDbDataAdapter("select photo from cards where id= " + intOrder, strCon);
DataSet ds = new DataSet();
adapter.Fill(ds, "cards");
// ds.Tables[0].Constraints.Add("pk_sno", ds.Tables[0].Columns[0], true);
picBox1.Image = null;
if (ds.Tables[0].Rows[rno][6] != System.DBNull.Value)
{
photo_aray = (byte[])ds.Tables[0].Rows[rno][6];
MemoryStream ms = new MemoryStream(photo_aray);
picBox1.Image = Image.FromStream(ms);
}
}
image not showing in picbox
|
|
|
|
|
Have you used your debugger to step through this code and check that all your variables are correctly loaded with the information that you have in the database, and that the picturebox image is a real image?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Richard MacCutchan wrote: Have you used your debugger
Oh you and your hilarious one liners.
|
|
|
|
|
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Richard's right. Add a breakpoint on the if statement. To do this, you can click on the line and press F9 (this is the shortcut to toggle the breakpoint on and off). You should see a red dot appear in the gutter in Visual Studio. Press F5 to run your application. When you hit the if statement, press F10 to step over the code. If you do this you will find out if this value is null or not.
Now, one thing I would do is wrap the MemoryStream in a using statement. A MemoryStream is a disposable object, so you should always dispose of it. This would give you:
using (MemoryStream ms = new MemoryStream(photo_array))
{
picBox1.Image = Image.FromStream(ms);
} Your code will now dispose of the stream.
|
|
|
|
|
Hi
I want to load a bitmap do some changes on the pixels and save it as new bitmap with a new name.
Will it work if I'll use the save method of the bitmap class (I'll give it as a parameter the path with the name "C:\\NewBitmap.bmp" for example, or is there another method for doing it?
thanks.
|
|
|
|
|
gibsray wrote: Will it work if I'll use the save method of the bitmap class
I can't see why not.
|
|
|
|
|
Yes - the Save method is the one to use.
Two things to note though:
1) Don't try to save it to the root directory - Vista and above won't let you write to the root of the boot drive to help prevent virus and trojan attacks - use a different directory unless you app has admin privileges.
2) Be careful what format you save the image in: many types including JPG are lossy compression, so each time you save and open it you will get a fuzzier, less detailed image. Use BMP or similar for working images, and JPG for final presentation only.
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
I can not icon & background in form design ....
Half Blood
|
|
|
|
|
Fascinating. Thanks for sharing.
|
|
|
|
|
That's bad news.
Perhaps if you shared what you've done, with relevant source code on, say, a site targeted at c# developers, they'd be able to help you
|
|
|
|
|
The quality of the question you ask directly dictates the quality of the answer you get.
Your question was so bad that the only possible answers were sarcasm. in other words, your question was nothing but a jumble of random words.
|
|
|
|