|
There are some issues when using Visual Studio Tools for Office and .NET 2.0 at the same time. VSTO is very picky with respect to the runtime it uses. My recommendation would be to uninstall VS2005 or, to fire up a Virtual Machine (in Virtual PC, since you've got MSDN) and try installing just VS2003 and VSTO in it.
Picture a huge catholic cathedral. In it there's many people, including a gregorian monk choir. You know, those who sing beautifully. Then they start singing, in latin, as they always do: "Ad hominem..."
-Jörgen Sigvardsson
|
|
|
|
|
I just want to hide some columns on my data grid (dynamically). I have my data grid, it's loading the data just fine, and all I want to do is make a column hidden.
Here's what I wrote:
this.dgClaimsExperience.Columns(1).Visible = false;
But C# tells me that System.Windows.Forms.DataGrid does not contain a definition for columns.
So... how do I do it?
Thanks.
The ends can never justify the means. It is the means that determine the ends.
|
|
|
|
|
DataGrid indeed does not contain a columns collection.
There are a couple of ways you can handle this, one way is to remove the DataGridColumnStyle for the column you want to hide from DataGrid.TableStyles. The tricky part is that if you want to put it back in it will move to the end of the list and you'll have to rearrange all the other columns (by removing them from the list and then adding them back in the right order).
Another way is to set the width of the column (through the DataGridColumnStyle) to zero, but I think the user can still resize it and I think it they can still tab to the column.
|
|
|
|
|
Thanks for the suggestions. I think removing the DataGridColumnStyle will work, because in the instance of the form where the data grid is located, I'm never going to want to add the column back in.
If you get a chance, post a code snippet for me, otherwise I'm sure I can figure it out on my own.
I'd just like to state for the record that I think that DataGrid [i]should[/i] contain a columns collection. It would be useful.
Thanks for the help - I'm the only "programmer" (I'm really a mathematical-statistical analyst) in my company so there's no one for me to take my sinple, dumb questions to in person.
-stormin
The ends can never justify the means. It is the means that determine the ends.
|
|
|
|
|
Something like this should work:
<br />
DataGridColumnStyle dgcs = MyDataGrid.TableStyles["MyTableName"].GridColumnStyles["MyColumnName"];<br />
MyDataGrid.TableStyles["MyTableName"].GridColumnStyles.Remove(dgcs);<br />
It's a little more efficient if you keep a reference to the table style and column style objects that you're using so that they don't have to be looked up each time, but the above code should work.
|
|
|
|
|
I'm a new to xml serialization and I haven't found much joy on the web.
How do i specify arbthree both nullable and a nonNegativeInteger? Or in otherwords have more then 1 attribute type?
i tried using them together like the following but I get a compile error
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
[System.Xml.Serialization.XmlElementAttribute(DataType="nonNegativeInteger")]
public string arbtwo;
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
public string arbone;
[System.Xml.Serialization.XmlElementAttribute(DataType="nonNegativeInteger")]
public string arbtwo;
public string arbthree;
|
|
|
|
|
In the code you posted above, it is correct to apply multiple attributes above the item such as your first example. If the entire example you have above is all in one class, that could be your problem. You are defining arbtwo twice.
I tried this but of code and it compiled with no errors:
<code>
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
public string arbone;
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
[System.Xml.Serialization.XmlElementAttribute(DataType="nonNegativeInteger")]
public string arbtwo;
[System.Xml.Serialization.XmlElementAttribute(DataType="nonNegativeInteger")]
public string arbthree;
</code>
|
|
|
|
|
Sorry it does compile but I get a runtime error.
You need to add XmlChoiceIdentifierAttribute to the 'arbtwo' member.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: You need to add XmlChoiceIdentifierAttribute to the 'arbtwo' member.
|
|
|
|
|
Well the syntax of the attribute tags is correct, so your code is not compiling for another reason. Can you paste some more of the code here so we can figure out why it's not?
|
|
|
|
|
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
namespace ITCService
{
///
/// Summary description for Test1.
///
public class Test1 : System.Web.Services.WebService
{
public Test1()
{
//CODEGEN: This call is required by the ASP.NET Web Services Designer
InitializeComponent();
}
#region Component Designer generated code
//Required by the Web Services Designer
private IContainer components = null;
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if(disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
#endregion
// WEB SERVICE EXAMPLE
// The HelloWorld() example service returns the string Hello World
// To build, uncomment the following lines then save and build the project
// To test this web service, press F5
[WebMethod]
public SomeDetail HelloWorld(InputDetail inputDetail)
{
return new SomeDetail();
}
}
public class SomeDetail
{
public int SomeValue;
public SomeDetail()
{
}
}
public class InputDetail
{
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
[System.Xml.Serialization.XmlElementAttribute(DataType="nonNegativeInteger")]
public int InputValue;
public InputDetail()
{
}
}
}
|
|
|
|
|
I copied and pasted everything you have here into a new class in my .NET environment and it compiled perfectly
|
|
|
|
|
It compiles fine.
Its giving me a runtime error when I goto the webservice.
Server Error in '/ITCService' Application.
--------------------------------------------------------------------------------
You need to add XmlChoiceIdentifierAttribute to the 'InputValue' member.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: You need to add XmlChoiceIdentifierAttribute to the 'InputValue' member.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidOperationException: You need to add XmlChoiceIdentifierAttribute to the 'InputValue' member.]
System.Xml.Serialization.XmlReflectionImporter.CheckAmbiguousChoice(XmlAttributes a, Type accessorType, String accessorName)
System.Xml.Serialization.XmlReflectionImporter.ImportAccessorMapping(MemberMapping accessor, FieldModel model, XmlAttributes a, String ns, Type choiceIdentifierType)
System.Xml.Serialization.XmlReflectionImporter.ImportFieldMapping(StructModel parent, FieldModel model, XmlAttributes a, String ns)
System.Xml.Serialization.XmlReflectionImporter.ImportStructLikeMapping(StructModel model, String ns)
|
|
|
|
|
Ahhh that makes sense. Well, just out of curiosity, did you do exactly what the error tells you to do? It's not done in the example you pasted. Add the XmlChoiceIdentifierAttribute to the InputValue member See below:
<code>
public class InputDetail
{
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
[System.Xml.Serialization.XmlElementAttribute(DataType="nonNegativeInteger")]
[System.Xml.Serialization.XmlChoiceIdentifierAttribute]
public int InputValue;
public InputDetail()
{
}
}
</code>
|
|
|
|
|
I still get a runtime exception.
|
|
|
|
|
Well silly, paste the new exception. It's probably a different exception than before. We'll work them out one by one.
|
|
|
|
|
Dear all
I am new to Visual studio 2005 beta, I am unable to connect Sql server 2000 database from DataBase explorer in VS 2005.when am going to establish connection to my sqlsever 2000 from Database explorer window(C# editor),it asks me the database file name,when i attach the database file even though it raises error that "Time out expire", Please help me
how to connect sqlserver 2000 from Database explorer.
Thanks In Advance.
|
|
|
|
|
Hello guys,
I am starting to study C# , having good background in C++ .
Could anybody recommend me a good book for C# programmnig.
thanks
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|
|
Programming C# by Jesse Liberty - O'Reilly Press
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant C++: C# to C++ Converter
Instant J#: VB.NET to J# Converter
Clear VB: Cleans up outdated VB.NET code
|
|
|
|
|
thanks
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|
|
i am working with c# console application.i am using MInternetExplorer.Explorer class of SHocVw.dll.basically i am parsing html pages.i am using following events as per my requirement
BeforeNavigate2()
DocumentComplete()
i am giving the website name for parsing. My problem is that when i give the name of website.i need IP address of that wesite before parsing.which event i need to capture in order to find the IP Address and which way i could find the IP address.
Please send the code If possible.
Amit Grover
CDAC R&D
Gist Group
pune
|
|
|
|
|
There's the System.Net.Dns class that can be used to resolve the name.
Regards,
mav
|
|
|
|
|
i need to access a public folder, then copy everything from that folder to another folder, then delete everything from the public folder...
any ideas...
or help wil be appreciated..
thanks
flipmode_dsi
|
|
|
|
|
Perhaps looking into the Directory[^] and File[^] classes would help. Each has methods for enumerating, copying, and deleteing folders and files.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Check out the cool HTM file that is located in the Exchange SDK. It is called webdavsample.htm. It does all that you are asking for. Look in the SDK/SAMPLES folder.
|
|
|
|
|
Hi!,
Please help if anyone knows how to retreive the folders/files allowed through the security permissions for a particulat user in one shot!! Because checking for each and every file will take hell lot of time!!
Akshay!
|
|
|
|