Skip to content

Change SPList.Title – no effect

September 13, 2012

When you try to change the Title of an SPList programmatically, you may see that your code executes without error but the Title of the list is not changed. I faced this problem when I was trying to change the Title from a console application where the SPContext did not exists.

I found the solution in this blog:

It turned out, that the CurrentUICulture of the SPWeb where your list is located MUST be the SAME as the CurrentUICulture of the thread where from you are updating the Title.

So now I use the following code to update a List’s Title:

private void UpdateListTitle(SPList list, string title)
	CultureInfo ci = Thread.CurrentThread.CurrentUICulture;
		if (SPContext.Current == null)
			Thread.CurrentThread.CurrentUICulture = new CultureInfo((int)list.ParentWeb.Language);
		// change list's title
		list.Title = title;
		if (SPContext.Current == null)
			Thread.CurrentThread.CurrentUICulture = ci
Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: