Posts

Showing posts from August, 2012

Hide buttons control from ribbon for specific list

Image
Hi , I want to hide "New Folder" button from ribbon of my library "Shared Documents" for site "SP2010-01".     To hide this button from ribbon for a Shared Documents, You must write this code : using (SPSite site = new SPSite("http://SP2010-01")) { using (SPWeb web = site.OpenWeb()) { SPList list = web.Lists.TryGetList("Shared Documents"); web.AllowUnsafeUpdates = true; SPUserCustomAction actionView = list.UserCustomActions.Add(); StringBuilder newurl = new StringBuilder(); newurl.AppendLine("<CommandUIExtension>"); newurl.AppendLine("     <CommandUIDefinitions>"); //Provide Location ID to hide the button newurl.AppendLine("        <CommandUIDefinition Location=\" Ribbon.Documents.New.NewFolder \">"); newurl.AppendLine("        </CommandUIDefinition>"); newurl.AppendLine("    </CommandUIDefinitions>");...

DateTimeControl is not showing it’s calendar in proper format

Image
Hi, Some time we have to create our own customized asp form or visual web part or simple web parts where we use SharePoint’s Date Time Control . Some time that control works properly but some time this control does not show calendar in proper format as we see in SharePoint. Control should show calendar like : But instead of the format, It shows like this : If you want to change this format for default format you have to write this code: dateTimeControl1.DatePickerFrameUrl=ResoulveRul(SPContext.Current.Site.Url+”/_layouts/iframe.aspx”);

Make Read Only or Hide Fields in SharePoint 2010

Hi , If you want to make field as read only or hide fields , you must read this article. It is too good. Just download files & install as instructed. To read full article :  SPUtility To read documents : Documents To download code files : Download