|
Hi All,
I am using VS 2008, 3.5 and am trying to add drag and drop functionality to the treeview. However, the allowdrop property is non existent on the treeview control.
I am baffled as to why this is the case.
Even when Ive instantiated the control it is neither existant nor does it appear behind the server control. help is much appreciated.
|
|
|
|
|
Uhm what treeview control are you using, the standard MS one (I presume you are using winforms) certainly has all the drag drop functionality.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
using VS 2008, asp.net 3.5 sp1. From what I am gathering the treeview control for webcontrols has no capacity for drag and drop, which exists for the winforms.
|
|
|
|
|
Have you ever seen drag and drop implemented on a web form? I think I have but VERY rarely. I notice the web control is categorised as a navigation control rather than a normal or data control, I would expect it to have different functionality.
I have a requirement for a web treeview (with D&D) coming up so I will be interested in your results.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Yes indeed , its quite rare from what I have seen thus far. Web control are very different to winforms controls indeed. I will let you know how I go, though time is something I dont really have in relation to using this for a project...so i might even neglect this all together and tinker with something else.
|
|
|
|
|
how to make lots of bmp files into one "movie" file
I have a lot of still images from a simulation, I need my application to take all those images and make them into 1 "movie" file, container format.
Can anyone give me a good idea on how to do that in VS8.
thorthebrave
|
|
|
|
|
Maybe the best is to create a fake wakecam...
This webcam will read files (BMP) or other formats and send it to the pin.
This can be easly done, and then use a regular tool in order to record your stream.
|
|
|
|
|
Can you elaborate on that. I have no clue what you are talking about.
|
|
|
|
|
Hi All,
I want to design a sliding forms in windows mobile environment using C#.NET, I know that this can be done using the Location property of the form, but unfortunately, when I change the property to be negative on the X - axis, once I call the resumelayout function, it will returned back again to the original location which is the point (0,0).
do u have any ideas or any workaround for this problem.
Regards
|
|
|
|
|
I have a dictionary call timeDate. where DriveDT is an object.
static Dictionary<string, DriveDT> timeDate = new Dictionary<string, DriveDT>();
I want to remove the value from the dictionary, the line im using is in the section else //unload
But the line isnt working.
timeDate.Remove(key);
private static void extractSE(string filePath)
{
StreamReader textIn = new StreamReader(filePath);
do
{
string text = textIn.ReadLine();
bool mail = text.Contains("Mail");
if(!mail)
{
if ((text != ""))
{
int indexofTO = text.IndexOf("to");
int indexofSLOT = text.IndexOf("Slot");
if (indexofSLOT < indexofTO)
{
int indexofInfo = text.IndexOf("Info");
string dtTxt = text.Substring(0, (indexofInfo - 1));
DateTime dt = DateTime.Parse(dtTxt);
string data = text.Substring(indexofInfo);
string key = text.Substring(indexofSLOT, (indexofTO - indexofSLOT - 1));
timeDate.Add(key, new DriveDT(dt, data));
}
else
{
string key = text.Substring((indexofTO + 2));
timeDate.Remove(key);
}
}
}
}
while (!textIn.EndOfStream);
}
modified on Monday, January 4, 2010 11:30 AM
|
|
|
|
|
Paul Harsent wrote: the line isnt working
that is unclear.
PS: please use PRE tags (the "code block" widget), I'm not interested in unformatted code.
You can still edit the message.
|
|
|
|
|
I think what Luc means is: use the "code block" widget to presever your formatting on your original code. that would produce:
if(!mail)
{
if ((text != ""))
{
int indexofTO = text.IndexOf("to");
int indexofSLOT = text.IndexOf("Slot");
if (indexofSLOT < indexofTO)
{
...
}
}
} which I think you will agree is easier to read than:
if(!mail)
{
if ((text != ""))
{
int indexofTO = text.IndexOf("to");
int indexofSLOT = text.IndexOf("Slot");
if (indexofSLOT < indexofTO)
{
...
}
}
} Just putting the tags around your already posted code doesn't do that - try the "Preview" button when you add tags.
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
Done, thanks. didnt realise.
|
|
|
|
|
right (actually this is the left side)
|
|
|
|
|
Much better, thanks.
Dictionary.Remove() removes an entry based on a key object, not the value. Even when two strings have equal content, they probably are different strings (unless they are simple reference copies, or both got interned).
Not sure what the easy solution is, I seldom remove things from a Dictionary.
[EDIT]
No, that is not it. A simple experiment shows Dictionary.Remove uses the default Comparer, which for strings compares the content.
Are you sure indexofTO + 2 is correct? How about indexofTO + 3?
[/EDIT]
modified on Monday, January 4, 2010 11:55 AM
|
|
|
|
|
Have you run this through the debugger? I bet the key is an empty string (or worse). If it can't find the key to remove, what exactly do you expect Remove() to do?
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
This line move media into a drive.
19/05/2009 10:53:40 Info Moved cartridge from Library 2 Slot 1 to Tape Drive 1
So I store the date time and the slot number(key) of when the media was moved into a drive, and when I see a removed media line, I used the date time from when it was moved out to show how long the media has been in.
I need to remove it from the dic because the media can be used again and I cant have duplicate keys.
FYI, there can be load of media being used at once, which I why I need to store this information.
An example of the data im reading in
19/05/2009 17:50:58 Info Moved cartridge from Library 2 Slot 4 to Tape Drive 1
19/05/2009 17:51:00 Info Moved cartridge from Library 2 Slot 8 to Tape Drive 2
19/05/2009 17:55:15 Info Moved cartridge from Library 2 Tape Drive 1 to Slot 4
19/05/2009 17:56:20 Info Moved cartridge from Library 2 Slot 1 to Tape Drive 1
19/05/2009 18:07:45 Info Moved cartridge from Library 2 Tape Drive 2 to Slot 8
19/05/2009 18:08:09 Info Moved cartridge from Library 2 Slot 7 to Tape Drive 2
20/05/2009 12:36:02 Info Moved cartridge from Library 2 Tape Drive 1 to Slot 1
20/05/2009 12:36:07 Info Moved cartridge from Library 2 Slot 6 to Tape Drive 1
20/05/2009 18:23:19 Info Moved cartridge from Library 2 Tape Drive 2 to Slot 7
|
|
|
|
|
So do any of the keys match the string you're building when you do your index math? That was my point.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
When I step through with the debugged. "Slot 1" is stored as the key in the dic and the on the loop that goes through to remove it the string key is also Slot 1.
|
|
|
|
|
Paul Harsent wrote: to remove it the string key is also Slot 1.
I don't think so, I expect it is " Slot 1" with a space.
|
|
|
|
|
Well, one thing that stands out to me is that the way you construct your key value on the Add and Remove is not symmetric.
string key = text.Substring(indexofSLOT, (indexofTO - indexofSLOT - 1));
string key = text.Substring((indexofTO + 2));
The key you use to Add has to match the key you use to Remove.
|
|
|
|
|
The reason for this is because the location of the key is different for loading and unloading.
19/05/2009 10:53:40 Info Moved cartridge from Library 2 Slot 1 to Tape Drive 1 //Load
19/05/2009 11:28:05 Info Moved cartridge from Library 2 Tape Drive 1 to Slot 1 //Unload
|
|
|
|
|
I understand the reason for it. I don't think your implementation is right. I think that you are off by 1 on your index in the second case so you end up with the wrong key value. If I am right, you are including a leading space in the key.
I am willing to be proved wrong, however, because that is just off the top of my head without trying it to check.
|
|
|
|
|
I feel very stupid. I was checking for the following space and having looked at the code for so long didnt see the lead space.
Thanks very much.
|
|
|
|
|
When you use
string key = text.Substring((indexofTO + 2));
the Substring method returns all the remaining text in the string starting from the supplied index. If you feel that the index position is correct try supplying a length parameter or verify there is no funky data at the end of the string. I've seen cases where odd characters have been thrown onto the end and caused me all kind of headaches especially when they are non-visual characters that most text editors won't render (like a Vertical Tab, ascii 11?). I recommend stopping at the above line in the debugger and checking all characters from indexofTO + 2 thru text.Length - 1 in the Watch window; check each individual character position and see if it contains the expected data.
Hold on a second here... Don't you think you might be putting the horse ahead of the cart?
|
|
|
|