Thursday, October 6, 2011

How to filter the data in data form web part using calender control

ParameterBinding Name="PFromDate" Location="Control(CalFrom,SelectedDate)" DefaultValue=""
ParameterBinding Name="PToDate" Location="Control(CalTo,SelectedDate)" DefaultValue=""

Convert the date into number (YYYYMMDD)

number(string(ddwrt:FormatDateTime(translate(string(ddwrt:FormatDate(string(@Report_x0020_Date),1033,1)),'/','-'),1060,'yyyyMMdd'))) >= number(string(ddwrt:FormatDateTime(translate(string(ddwrt:FormatDate(string($PFromDate),1033,1)),'/','-'),1060,'yyyyMMdd'))) and number(string(ddwrt:FormatDateTime(translate(string(ddwrt:FormatDate(string(@Report_x0020_Date),1033,1)),'/','-'),1060,'yyyyMMdd'))) <= number(string(ddwrt:FormatDateTime(translate(string(ddwrt:FormatDate(string($PToDate),1033,1)),'/','-'),1060,'yyyyMMdd')))

old: Wrong Calc
number(translate(string(ddwrt:FormatDate(string(@Report_x0020_Date), 1033, 1)),'/','')) >= number(translate(string(ddwrt:FormatDate(string($PFromDate), 1033, 1)),'/','')) and number(translate(string(ddwrt:FormatDate(string(@Report_x0020_Date), 1033, 1)),'/','')) <= number(translate(string(ddwrt:FormatDate(string($PToDate), 1033, 1)),'/',''))


number(translate(string(ddwrt:FormatDate(string(@Report_x0020_Date), 1033, 1)),'/','')) = number(translate(string(ddwrt:FormatDate(string($PFromDate), 1033, 1)),'/',''))

ddwrt:FormatDate(string(@Report_x0020_Date), 1033, 1) >= ddwrt:FormatDate(string($PFromDate), 1033, 1) and ddwrt:FormatDate(string(@Report_x0020_Date), 1033, 1) <= ddwrt:FormatDate(string($PToDate), 1033, 1)

number(translate(string(ddwrt:FormatDate(string(@Report_x0020_Date), 1033, 1)),"/",""))

number(translate(string(ddwrt:FormatDate(string($PFromDate), 1033, 1)),'/',''))

Wednesday, October 5, 2011

How to disable the RichTextBox in SharePoint

function disableRichTextBox(ctrlComments)
var elm = document.getElementById( + "_toolbar");
if (elm) {elm.disabled=true; elm.readOnly = true; = 'none';}
elm = document.getElementById( + "_iframe");
if (elm) {elm.disabled=true; elm.readOnly = true; = 'none';} = 'block';

Wednesday, August 31, 2011

SharePoint 2010 Ribbon Customization

Monday, August 1, 2011

New SharePoint 2010 content for download

Friday, March 25, 2011

Hide List View Tool bar Items

function hideListViewToolbarItems()
var doc = document.getElementsByTagName('ie:menuitem');
for (var i = 0; i < doc.length; i++) {
var itm = doc[i];
if ('OpenInExplorer') != null)
var p = itm.parentNode;


A few thoughts as to why it's not working...

1) Match for part of the text and leave off the "zz33_" as that part can be different for every page.

2) Don't delete the nodes, hide them

3) Make sure your code is loaded after the web part with the View dropdown (i.e. if using a Content Editor Web Part, move it under the list web part)


Thursday, March 24, 2011

Add Web Parts to DispForm, EditForm or NewForm.aspx

One of the users of our SharePoint project asked if it was possible to show an “Item List” on the “View Item” page.

My first reaction was: “Of course it is, add a Web Part displaying the “Item List” to the page and we’re done”.

But when I browsed to the “View Item” page and clicked the “Site Actions” I noticed that there wasn’t an “Edit Page” option available. Strange, but after some -Googling- I found the following sollution:

  • Open IExplorer and navigate to your “View Item” page (DispForm.aspx)
  • Replace everything in the URL after “?ID=#“ with “&PageView=Shared&ToolPaneView=2″ (without the quotes of course) and press
After adding a Web Part to the page and saving it, the “Edit Page” option will be available the next time you click “Site Actions” on that Page.