PANVEGA’s Blog

DotNet Development, SharePoint Customizing, Silverlight, MS Infrastructure and other tips and tricks

Posts Tagged ‘Visual Studio’

Custom SharePoint TreeView Navigation with CodeBehind

Posted by PANVEGA on July 12, 2009

In this short post I gonna explain how easy it is to customize your tree view navigation. In one of my prevois post I explaind how to customize your QuickLaunch Left Navigation in your MasterPages ASP:Menu properties. However the confiuration at this point was limited. I needed a dynamic 3 Level with an automatic expaned and collapse menu.

Read my previous post first:

https://panvega.wordpress.com/2008/04/18/customize-the-sharepoint-navigation-aspmenu

You can solve this problem by using asp:TreeView control: Read the rest of this entry »

Posted in C#, DotNet, MasterPage, MOSS | Tagged: , , , | 3 Comments »

Custom Silverlight Navigation with the SP PortalSiteMapProvider

Posted by PANVEGA on June 2, 2009

In this post I wanna explain in a few steps how to develope a custom Silverlight Navitgation for SharePoint publishing sites (Source Silverlight Blueprints on CodePlex)

SharePoint and Silverlight Blueprints on CodePlex were uploaded to include two more Silverlight RTM samples: custom navigation in SharePoint and the colleague viewer. These blueprints provide samples for you to build and explore using Silverlight as an alternate way to develop and integrate powerful user experiences within SharePoint and add rich Internet application functionality to your SharePoint sites. Included in the overall set of samples are a Hello World sample, a Slider sample, and the recently added Custom Navigation and Colleague Viewer samples added

Read the rest of this entry »

Posted in ASP.NET, C#, DotNet, MasterPage, MOSS, Silverlight | Tagged: , , , , , | 1 Comment »

How to manipulate InfoPath with CodeBehind

Posted by PANVEGA on February 16, 2009

I wonna show you how easy it is to manipulate the InfoPath Formular in C# Codebehind. The compiled DLL becomes part of the InfoPath form template (XSN) file.

1. First you have to install the VSTA tools for Visual Studio.

With the familiar Visual Studio development environment, VSTA enables Visual Basic and Visual C# developers to easily build managed customizations for both COM and .NET applications. The VSTA SDK includes integration tools, samples, and documentation to help you get started with VSTA.

Download Visual Studio Tools for Applications (VSTA)  here

2. Then create in InfoPath a new Formular with some for instance textboxes and Submit buttons. Under Tool–> Programming –>Microsoft Visual StudioTools… you will automatically redirected to the VS CodeBehind InfoPath Project.

3. In addition the Tool deploys a dll in your XSN file when building the project. Read the rest of this entry »

Posted in C#, DotNet, InfoPath, MOSS, XPath | Tagged: , , , , | 2 Comments »

Using ASP in JavaScript for URL Encoding in SharePoint fields

Posted by PANVEGA on February 3, 2009

In this post I want to show you how to rebuild the standard MyLinks –> Add to My Links for a custom MyLinks Control in Visual Studio and using ASP in JavaScript.

Active Server Pages exposes an object called ServerVariables, which is part of the Request object. This ServerVariables object allows the programmer to see many environment variables. You can use the ServerVariables along with IIS’s directory sercurity options to determine who is currently accessing your site. You can also grab the visitor’s IP address using the ServerVariables object. This article includes a question and answer from the Activer Server Pages mailing list, as well as an excerpt from the Visual InterDev 1.0 help files detailing all of the properties of the ServerVariables object.

https://panvega.wordpress.com/2008/02/24/different-way-how-to-customize-the-mylink-in-moss (4. How to develop your custom MyLink Control in Visual Studio.) Read the rest of this entry »

Posted in ASP.NET, C#, Delegate Controls, Deployment, DotNet, JavaScript, MOSS, My Links, My Site | Tagged: , , , , , , , | 2 Comments »

Introduction in Custom WF Activities

Posted by PANVEGA on January 20, 2009

Microsoft Office SharePoint Designer 2007 allows non-developers to create custom workflows in a straightforward way by using the workflow designer it provides. During the process, the user “glues” together different activities that represent the steps for the workflow. There are numerous activities one can use and the list is extensible. Developers can use Microsoft Visual Studio 2005 to build additional activities and deploy them, so that they are available in Office SharePoint Designer 2007.

My example in the post extendes the default out of the box Activity in the SP Designer (Copy List item). In the default activity you can only copy an item in the same site. I added a new attribute DestinationListUrl which copies the select item from the root list by using the SP Object Model to the destination list in an other site collection.

copyitem

On Codeplex you find some useful custom SP Activities Read the rest of this entry »

Posted in Administration, C#, Deployment, DotNet, MOSS, Object Model, SPDesigner, Workflows, XML | Tagged: , , , , , , , , | Leave a Comment »

How to add a SPFeatureReceiver to a Custom ListInstance?

Posted by PANVEGA on January 19, 2009

In reference to my previous post about binding a Custom ContentType to a new ListInstance, I wanna solve this issues belowe with a SPFeatureReceiver class in Visual Studio.

https://panvega.wordpress.com/2009/01/19/how-to-bind-a-customcontenttype-to-a-listinstance-feature

https://panvega.wordpress.com/2008/11/05/how-to-develope-a-custom-sp-eventreceiver

First off the default view of your list does not contain those custom columns. When you select the item you will of course see all of your columns but they aren’t listed in the default view. Secondly the default content type for the list is still available to the user. In the case of a generic list the “Item” content type is still present. So when a user enters a new item they are able to select Item or your custom content type. This may not be desirable. Also if you are using the API to insert a new item into the list it will use the list’s default content type instead of the one you may be expecting. Once again this may not be desirable.

To overcome these restrictions we’re going to create a generic feature receiver that can be reused on any implementation using this technique. Read the rest of this entry »

Posted in C#, Custom Content Types, Deployment, DotNet, Event Receivers, MasterPage, MOSS, Object Model, Site Definition | Tagged: , , , , , , , , | Leave a Comment »

How to develope a Custom SP EventReceiver

Posted by PANVEGA on November 5, 2008

In this example I wanna show you how to easy it is to develope a synchron Task für a SP List in Visual Studio. The receiver event fires, when you want to delete e.g. a task from the Tasklist while it is under progress or not complete. That is why we need a synchron Task. Here you cancel the deleting action and throw an error message.

Synchonous event ends with at -ing e.g. ItemDeleting.  Asynchonous event ends with at -ed e.g. ItemDeleted.

Read the rest of this entry »

Posted in Deployment, Event Receivers, MOSS | Tagged: , , | Leave a Comment »

Integrate an UserControl .ascx into a .aspx Page

Posted by PANVEGA on July 4, 2008

Introduction:

User controls provide a means by which custom graphical interfaces can be created and reused. A user control is essentially a component with a visual representation. As such, it might consist of one or more Windows Forms controls, components, or blocks of code that can extend functionality by validating user input, modifying display properties, or performing other tasks required by the author. Read the rest of this entry »

Posted in ASP.NET, DotNet, UserControls | Tagged: , , , | Leave a Comment »

Accessing a SP List via Lists.asmx WS by using Views

Posted by PANVEGA on March 19, 2008

In this short post I wanna show you why accessing the Lists.asmx Webservice by giving the appropriate View ID as a parameter. In one of my previous posts I gave you a detail view in this SharePoint Webservice.

https://panvega.wordpress.com/2007/09/15/consuming-listsapsx-webservice-from-sharepoint

I wanna demonstare why it is usefull accesing a custom WS view. If you leave the View parameter in your method  null, the service always reference to the default List View. However usually your default View is what the user should see, when he enters the list. When you wanna hide any fields, which are not interesting for the user, but for your Webservice consumtion, you should build a custom backend View extra for your Webservice.

Note. You only receive the values from the View you just accessed. Other columns are not in your WS return value.

You get the View ID for instance from the URL.

Read the rest of this entry »

Posted in C#, DotNet, MOSS, WebServices | Tagged: , , , | Leave a Comment »

SharePoint Webpart Properties Overview

Posted by PANVEGA on January 30, 2008

 

There are a few others that you might find valuable to know about. Some of the other attributes are listed below along with explanations and links to further resources. 

To access the property pane, select the Edit mode of the Web Part. Then click the down arrow located at top right hand corner of the Web Part. Select “Modify Shared web part” (or personnel depend on witch mode the Web Part is running

 

WebBrowsable [WebBrowsable(True)]
“Indicates whether the designated property of a Web Parts control is displayed in a PropertyGridEditorPart object.” (MSDN)
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.webbrowsableattribute.aspx

WebPartStorage [WebPartStorage(Storage.Personal)]
This attribute specifies what type of storage options the WebPart will make use of. The most common is Storage.Personal. “This property can be personalized by individual users. Its WebPartStorageAttribute value is Storage.Personal, which specifies that the property can be stored on a per-user basis. Only users with the Personalize Web Part pages right can set this property.” (MSDN)
http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.webpartpages.webpartstorageattribute.aspx

Personalizable [Personalizable(true)]
Allows users the ability to personalize settings for the WebPart.
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.personalizableattribute.aspx

WebDispayName [WebDisplayName(string)]
Defines the Friendly Name for a property of a WebPart control. This is the name that will show up in the editor screen.
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.webdisplaynameattribute.aspx

WebDescription [WebDescription(string)]
Defines the string value to use as a ToolTip for a property of a Web Parts control. (MSDN)
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.webdescriptionattribute.aspx

SPWebCategoryName [SPWebCategoryName(string)]
Defines the friendly or localized name of the category of a property in the CustomPropertyToolPartcontrol inside the ToolPane.
http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.webpartpages.spwebcategorynameattribute.aspx

ConnectionProvider [ConnectionProvider(string)]
Identifies the callback method in a server control acting as the provider in a Web Parts connection, and enables developers to specify details about the provider’s connection point. (MSDN) This is used to create connectable WebParts.
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.connectionproviderattribute.aspx

ConnectionConsumer [ConnectionConsumer(string)]
Identifies the callback method in a server control acting as the consumer in a Web Parts connection, and enables developers to specify details about the consumer’s connection point. (MSDN) This is used to create connectable WebParts.
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.connectionconsumerattribute.aspx

/// Default property available form the template
            ///</summary>
            [Browsable(true),Category(“Miscellaneous”),
            DefaultValue(defaultText),
            WebPartStorage(Storage.Personal),
            FriendlyName(“Text”),Description(“Text Property”)]

            publicstring Text
            {
                  get
                  {
                        return text;
                  }

                  set
                  {
                        text = value;
                  }
            }

 

More Links:

http://www.15seconds.com/issue/040218.htm

http://www.sharepointsecurity.com/blog/sharepoint/auto-implemented-properties-and-developing-webparts/

Posted in DotNet, MOSS, WebParts | Tagged: , , | Leave a Comment »

Create a custom $Resources file .resx for SharePoint.

Posted by PANVEGA on November 12, 2007

In a country where English is not the native tongue, localisation can be pretty important. Localisation within SharePoint is achieved by using resources and resource files. Although the use of resources is not mandatory, it’s usually good practise to use them anyway. You don’t want to hard code strings in your application, and, moreover, you never know when your application should be localized. Setting up and using these resources in SharePoint can be quite confusing. So here is a little article covering this topic.

Read the rest of this entry »

Posted in ASP.NET, Deployment, MOSS | Tagged: , , | Leave a Comment »