Showing posts with label Sharepoint Tips and Tricks. Show all posts
Showing posts with label Sharepoint Tips and Tricks. Show all posts

How to show a file extension within a document library

Hi All,

In SharePoint Document Library, the file extension is not display when you upload any new documents. To show the file with extension, Following steps need to implement:

1. Open up the .aspx file responsible for displaying the document list in Sharepoint Designer, in my case it is called AllItems.aspx

2. Select the WebPartPages:ListViewWebPart control. (It is the place where rows of document are listed)

3. Right-click on it, Convert to XSLT Data View

4. Go into the code and find the line that says:

<xsl:value-of select="ddwrt:UrlBaseName(string(@LinkFilename))" />

5. Add this to the end of the line:

.<xsl:value-of select="@File_x0020_Type" />

6. Save

Hope it will helpful to you.


How to change language of an existing SharePoint site collection

Hi All,
Recently I had problem with SharePoint site. The problem was that the site was created in “English” and I want to change the language from ‘English’ to ‘Dutch’. Once site Collection has been created with any language, I was not able to change the language with existing site collection.
After doing some research I found solution.

Resolution:
The language of the site is stored at SP Web level. It is stored in database in Webs table. So you need to change the language in database whatever language you want. To change the language in database you need to fire following Query:

For changing the language of all sites in to ‘Dutch’ language:
UPDATE dbo.Webs SET Language = 1043

Changing the language of one site collection: (Dutch language)
UPDATE dbo.Webs SET Language = 1043 WHERE SiteId = [[SiteCollectionId]]

Changing the language of a single web or subsite: (Dutch language)
UPDATE dbo.Webs SET Language = 1043 WHERE Id = [[WebId]]

Note:
Before applying the new language, you need to verify that the language pack for the language that you want to apply is installed on your machine or not. If language pack is not installed then follows the below steps:

1. Go to link:
http://www.microsoft.com/downloads/details.aspx?FamilyID=2447426b-8689-4768-bff0-cbb511599a45&displaylang=en
2. Change the language for what you want to install the pack. Click on Download.
3. SharePoint Products and Technologies Configuration Wizard will open after installing language pack. On the completing the SharePoint Products and Technologies Configuration Wizard, click Next.
4. On the Configuration Successful page, click Finish.
5. The new language’s folder is available at ‘C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\template’. (I.e. for English it would be ‘1033’, for Dutch it would be ‘1043’).


After installing language pack, you can apply different language with SharePoint site.

Hopefully it will helpful to you.

Adding Paging in SPGridview

Hi Guys,

Many times we need to create custom SpGridview control and need to add paging in such control,Here I have gone through bit of code which facilitate to add paging in SPGridview Control.

SPGridView gv = new SPGridView();
gv.AutoGenerateColumns = false;
gv.AllowPaging = true;
gv.PageSize = 10;
gv.PageIndexChanging += new GridViewPageEventHandler(gv_PageIndexChanging);

gv.PagerTemplate = null; //You must add this line before binding the DataSource.
gv.DataSource = dv;//Here dv is an object of Dataview
gv.DataBind();

Now you need to add PageIndexChanging Event.

void gv_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
gv.PageIndex = e.NewPageIndex;
gv.DataBind();
}

Hope it will help you.

Creating Custom Site Definition in WSS / MOSS

Site Definition: It is foundation on which all sites and templates are built. Inside each site definition sub directory the aspx pages for the various WebPages and lists that make up site definition are stored.

The Site Definition folder is located at ‘C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates’ on the SharePoint Server.
Each Site Definition has its own sub directory under this folder.

Steps to Create Custom Site Definition:

1. Navigate to ‘C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates’

2. Copy the STS directory and paste it to back in same directory, Rename the Copy STS directory to DEMOTEST.

3. Navigate to ‘C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033’

4. Follow the same procedures as you follow in step -2 and step-3 for STS directory.

5. Navigate to ‘C:\Program Files\Common Files\Microsoft Shared\web server
extensions\12\TEMPLATE\1033\XML’

6. Copy the WEBTEMP.XML file and paste it in to same directory and rename it ‘DEMOTESTWEBTEMP.XML’.

7. Put the following lines into the DEMOTESTWEBTEMP.XML

<?xml version="1.0" encoding="utf-8" ?>
<!-- _lcid="1033" _version="12.0.4017" _dal="1" -->
<!-- _LocalBinding -->

<Templates xmlns:ows="Microsoft SharePoint">

<Template Name="DEMOTEST" ID="10001">

<Configuration ID="0" Title="Sample Site" Hidden="FALSE" ImageUrl="/_layouts/images/stsprev.png" Description="This sample template creates a site for teams to create, organize, and share information quickly and easily. It includes a Document Library, and basic lists such as Announcements, Calendar, Contacts, and Quick Links." DisplayCategory="Custom Site Definitions" > </Configuration>

<Configuration ID="1" Title="Sample Blank Site" Hidden="FALSE" ImageUrl="/_layouts/images/stsprev.png" Description="This sample template creates a Windows SharePoint Services-enabled Web site with a blank home page. You can use a Windows SharePoint Services-compatible Web page editor to add interactive lists or any other Windows SharePoint Services features." DisplayCategory="Custom Site Definitions" > </Configuration>

<Configuration ID="2" Title="Sample Document Workspace" Hidden="FALSE" ImageUrl="/_layouts/images/dwsprev.png" Description="This sample template creates a site for colleagues to work together on documents. It provides a document library for storing the primary document and supporting files, a Task list for assigning to-do items, and a Links list for resources related to the document." DisplayCategory="Custom Site Definitions" > </Configuration>

</Template>

</Templates>

8. Reset IIS

9. Go to SharePoint Central AdministratoràCreate Site Collection. In TemplateSelection
Section, the new tab named ‘Custom Site Definitions’ available.

That’s it...Hope this helps