|
No clue. Apparently it's another one of those Windows "features" that work for some and not for others... I'll keep looking. Thanks.
Kyosa Jamie Nordmeyer - Taekwondo Yi (2nd) Dan
Portland, Oregon, USA
|
|
|
|
|
Jamie Nordmeyer wrote: No clue. Apparently it's another one of those Windows "features" that work for some and not for others... I'll keep looking. Thanks.
What you're seeing isn't an intentional sliding effect, it's a slow redraw (actually, it's "tearing" - the drawing passes are falling between screen refreshes). All of the nodes below the ones being collapsed have to be moved up and redrawn, and what you're seeing is the redraw versus the refresh rate of your monitor.
There's no sliding. If there were, it would be consistently and always obvious. There's also nothing you can do about it.
It has become appallingly obvious that our technology has exceeded our humanity. - Albert Einstein
|
|
|
|
|
Greetings,
I am working on a project that is way to big for me, but I thought I would try and tackle it anyway as an opportunity to learn more.
Within my application I am trying to develop a static method that I can use to convert a time such as 1:15 (1 hour 15 minutes) to a decimal.
I understand the formula, since I used it in Excel before. I need to take the input value from the user, pass it to the method, and multiply it by 24. This will give me the decimal value that I need.
My question is strangly simple, and I am still just stumped by it... what data type do I need to use to get my user information into my method? It's just the colon in the user value that throws me off.
Can I just take in "xx:xx" as a string value and then use "Convert.ToDecimal"?
I'm sorry if I am not clear enough. If it's not, let me know and I will be happy to rephrase.
Beginning Programmer - Still learning as much as possible.
|
|
|
|
|
Hi,
if the method is to accept a date, you basically have two choices:
- pass it a DateTime instance
- pass it a string representing a date, and use DateTime.Parse inside the method to decode it
whatever you choose the method will need DateTime.Hours and DateTime.Minutes to calculate
the integer value you want.
I don't expect Decimal type will be of much help.
|
|
|
|
|
Thank you very much! I really appreciate it!
Beginning Programmer - Still learning as much as possible.
|
|
|
|
|
I have a com object dll file called MyCom.dll with some classes, interfaces, methods and events.
I can add it as a reference to my project in visual studio IDE and create an instance from one interface that i need:
MyDllLib.InterfaceName myobject = new MyDllLib.InterfaceName();
I can also access all the events and methods for this interface via myobject.
So by some reason i dont want to add this com dll file to my project references and dont ask why! My question is how can instantiate an interface from a com dll file and access it's methods and events.
If i dont add it as a reference in .Net IDE so i can't reference it.
Could someone recommend the best solution for this.
Thank You,
|
|
|
|
|
Shahin77 wrote: i dont want to add this com dll file to my project references and dont ask why! My question is how can instantiate an interface from a com dll file and access it's methods and events.
Shahin77 wrote: Could someone recommend the best solution for this.
There is no "best solution". Doing this just makes your life so much more difficult, it's not worth it. You've just about trippled the amount of time it'll take to write your code to consume this library, being that you lose all type safety and Intellisense, not to mention that you'll have to write the code to load this library and initialize it. You'll also need to write the code to lookup and instantiate objects, manually wire up events, ..., ..., yada, yada, yada...
Why would you want to ignore all the benefits of early binding and having the compiler do all the dirty work for you??
|
|
|
|
|
The reason is im working on a project which is shared between 20 developers and i dont want to add any reference to the project, I dont want any dependency to this dll file when i compile. So any idea?
Thank You
|
|
|
|
|
There isn't a way around this. The dependancy is GOING to be there no matter if you use a reference or not.
With the reference, you just made using this library about 100x harder to use because now your developers have to write their own code to load the library, init it, lookup and instantiate objects, wire up events, ..., ..., ...
It's simply not worth it. There is no "easy" way around this.
If you've chosen to export your library as a COM-based .DLL, you've also locked yourself into DllHell and the dependancies that come with COM. You simply have no way around this.
Now, if the library is exported as a normal .NET library, the dependancies go away and you can even setup the app's app.config file to redirect dependancies to new version of the library assembly.
|
|
|
|
|
We didnt create this com dll file, we just have to use it and there are just one method call & one event handeling from dll. I tried this:
Type comType = Type.GetTypeFromCLSID(new Guid("{95D4B070-6A73-11D5-95B0-0008C7E92339}"));
object instance = Activator.CreateInstance(comType);
But the second line fails, i dont know why!! might be some dependency, but anyway there should be a way!!
Thank You
|
|
|
|
|
Shahin77 wrote: But the second line fails
Standard question #1: What's the error message?? There's about a dozen reasons this can fail...
I've found a rather good explanation of the pain you're about to put yourselve through here[^]. It's a 6 page article from back in 2002, but just about everything still applies today.
modified on Wednesday, January 09, 2008 3:43:09 PM
|
|
|
|
|
I have a datagridview with 4 columns and want to prohibit the user from clicking a header of a column to sort it. I can't seem to find a way to do this. I am using .net 2.0
- joe
|
|
|
|
|
Did you look at all the properties available for the DataGridView control in the Designer?
|
|
|
|
|
I did - I can not find anything that controls this in the designer or through any other 'obvious' method.
- joe
|
|
|
|
|
Joe Marchionna wrote: I can not find anything
The DataGridView has a property named Columns. In the columns editor each column has a property named "SortMode"
|
|
|
|
|
led mike, thanks for the lead - I didn't think it would be as part of each column's properties. my fault, thanks for the help!!
- joe
|
|
|
|
|
Hello experts
i would like to know how to delete a row from a dataGrid (which is in edit mode), i am using paging and the built in edit, update, cancel methods.
I have been looking all over the posts most seem to be using databases and since i am using a XML file as my surce of data i am abit lost.
heres what i have in my delete event Handler..
private void dgStudents_DeleteCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
int rowToDelete = e.Item.ItemIndex;
dsStudents.student.Rows[rowToDelete].Delete();
//refresh datagrid control to show changes
BindData();
}
the rowToDelete int will get the row to delete, but when i run this and click on delete, i get a runtime error of "There is no Row at position 0"
Help please??
Cheers
|
|
|
|
|
I have a class "Foo" with a flag-type enum property that I do NOT want to serialize by name as many of the values can be serialized as a combination of misleading things (some of the flags have different meaning based on other flags, so both "LanguageSpanish" and "ChicagoBears" could have the same enum value of 5. With default serialization, if I meant to use LanguageSpanish, I could end up receiving ChicagoBears or vice-versa). Therefore, I am attempting to get this enum value as an integer. I do this by adding another property to my class that is of type ulong (the base type of the enumeration). However, the ulong type is serialized as a base-10 integer, when I want it to be in hex representation as it is a flags field. Is there any way to get the ulong property (or the enum) to serialize in hex, or am I resigned to using a string as the property type? The following example illustrates what I mean assuming the enum type I am using is "AnotherFlag | LanguageSpanish".
public enum TestEnum : ulong {
ChicagoBears = 5,
LanguageSpanish = 5,
AnotherFlag = 8,
...
}
[Serializable]
public class Foo {
public TestEnum EnumValue { get; set; }
public ulong UlongValue { get; set; }
public string StringValue { get; set; }
} Thanks,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
Implement the System.Runtime.Serialization.ISerilizable interface and go nuts. Don't forget the protected constructor for deserializatoin.
-----
You seem eager to impose your preference of preventing others from imposing their preferences on others. -- Red Stateler, Master of Circular Reasoning and other fallacies
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
God is the only being who, to rule, does not need to exist. -- Charles Baudelaire
|
|
|
|
|
I was hoping there was simply a setting on the serialization engine, but I guess this will do (using IXmlSerializable... ISerializable didn't work for me). I am slightly concerned, however, since a client needs my deserializer on the other side. I will have to try to mimick the auto-generated xml so a C# programmer can interface with my web service using only the WSDL. Thanks,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
How come ISerializable does not work for you?
-----
You seem eager to impose your preference of preventing others from imposing their preferences on others. -- Red Stateler, Master of Circular Reasoning and other fallacies
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
God is the only being who, to rule, does not need to exist. -- Charles Baudelaire
|
|
|
|
|
I don't know, but when I implemented that interface (and the corresponding constructor), nothing changed. The code within those methods was never executed. I am serializing these objects to/from a web service, which is apparently different from other methods of serialization. Almost everyone who has given me serialization advice tells me the same thing you told me, so I must be implementing the uncommon case or something. Anyway, thanks again for the help,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
Ok, I understand. ISerializable is for binary serialization.
For XML, what you could do is implement properties and decorate them with the attributes of the System.Xml.Serialization namespace. For instance, suppose you want to serialize an enum into an hexadecimal string:
<code>
public class MyClass
{
public enum SomeEnum
{
EnumValue1 = 1,
EnumValue2 = 2
}
private SomeEnum _myEnum = SomeEnum.EnumValue1;
[XmlElement(ElementName="MyEnum")]
public string MyEnumAsHexString
{
get
{
return String.Format("{0:X}", (int)this._myEnum);
}
set
{
int enumValue = Int32.Parse(value, NumberStyles.AllowHexSpecifier);
this._myEnum = (SomeEnum)enumValue;
}
}
[XmlIgnore]
public SomeEnum MyEnum
{
get
{
return this._myEnum;
}
set
{
this._myEnum = value;
}
}
}
</code>
So, in the example above, your web service will serialize only the hexadecimal string property because the other one is tagged with [XmlIgnore].
-----
You seem eager to impose your preference of preventing others from imposing their preferences on others. -- Red Stateler, Master of Circular Reasoning and other fallacies
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
God is the only being who, to rule, does not need to exist. -- Charles Baudelaire
|
|
|
|
|
Yeah, I thought about doing that, but didn't like the fact that it no longer contained information about the type. Clients (of my WS) would see a string that looks like hex, but maybe it is a GUID without the slashes, or an IPv6 ip address without the colons... you get the idea. I was hoping there was an attribute to tell the serializer, "I have this enum that I want you to pass by hex value", then clients on the receiving end would get the type as enum and it would deserialize appropriately. Anyway, I came up with a different (probably better) way of doing what I was attempting to do (combining multiple fields into a single flags value). Instead of combining fields in a cryptic way for the end user of my service, I simply serialize a more verbose object back, splitting the fields into their own properties. The following illustrates this:
public enum Language {
Spanish = 1,
English = 2,
}
public enum Country {
USA = 1,
DEU = 2,
}
public class CountryAndLanguage { ... }
The reason I was attempting the first way was because I was misinformed that I could not return abstract types from a web service. Therefore, I thought that I had to have a concrete return type that would hold all the information contained within all derived types. This is incorrect, which is why I am now using the "correct" way of doing this mentioned above. Thanks again for the help,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
I don't know if this will work with SOAP, but you get the idea: A property that is used for serialization and another that is used in C# code.
-----
You seem eager to impose your preference of preventing others from imposing their preferences on others. -- Red Stateler, Master of Circular Reasoning and other fallacies
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
God is the only being who, to rule, does not need to exist. -- Charles Baudelaire
|
|
|
|
|