lblQ.Text = "what is the result of the following equation?";
Panel1.Controls.Add(lblQ);
rdOptions.Items.Add(First(dt.Rows[intOpt][2].ToString()));
rdOptions.RepeatDirection = RepeatDirection.Horizontal;
rdOptions.RepeatLayout = RepeatLayout.Table;
rdOptions.RepeatColumns = 2;
rdOptions.Width = 400;
rdOptions.CellSpacing = 3;
rdOptions.CellPadding = 3;
Panel1.Controls.Add(rdOptions);
Rowfilter on DT using DataView
-------------------------------
DataView dvSearchResults = dt.DefaultView;
dvSearchResults.RowFilter = "Name LIKE " + "'" + lastname + "%" + "'";
Removing the rows in the column 'Name' containing "Unknown"
------------------------------------------------------------
DataRow[] unknownRecords=ResultsTable.Select("Name='Unknown *'");
foreach(DataRow drUnknownRecs in unknownRecords)
ResultsTable.Rows.Remove(drUnknownRecs);
Querying using DataRow[] object and select Method(XYZ- col name)
--------------------------------------------------
DataRow[] flagDeletedRecords=dtChildActivity.Select("XYZ=1");
Like Operator in DataTable using DataTable.Select
------------------------------------------------
Select("Code LIKE '" + lastWord + "%'" );
Friday, March 20, 2009
searching for a word in a column
searching for word Manager in the column 'Job Title' and make it bold if it have
=CONCATENATE("<DIV",IF(ISERROR(SEARCH("Manager",[Job Title],1))," "," style='font-weight:bold;'"),">",[First Name]," ",[Last Name],"</DIV>")
=CONCATENATE("<DIV",IF(ISERROR(SEARCH("Manager",[Job Title],1))," "," style='font-weight:bold;'"),">",[First Name]," ",[Last Name],"</DIV>")
Restoring the Quick Launch Bar in Web Part Pages
You'll notice that when creating Web Part Pages in SharePoint 2007 that the Quick Launch Bar is not included in the template. Here are the quick instructions (that require SharePoint Designer) to restore the Quick Launch Bar:
Open the web part page in SharePoint designer
Find and delete the following two lines:
asp:Content ContentPlaceHolderId="PlaceHolderLeftNavBar" runat="server"
asp:Content ContentPlaceHolderId="PlaceHolderNavSpacer" runat="server"
Save the file
Open the web part page in SharePoint designer
Find and delete the following two lines:
asp:Content ContentPlaceHolderId="PlaceHolderLeftNavBar" runat="server"
asp:Content ContentPlaceHolderId="PlaceHolderNavSpacer" runat="server"
Save the file
SPSite and SPWeb
using(SPSite oSiteCollection = new SPSite("http://Server_Name"))
{
using(SPWeb oWebsite = oSiteCollection.OpenWeb("Website_URL"))
{
using(SPWeb oWebsiteRoot = oSiteCollection.RootWeb)
{
...
}
}
}
{
using(SPWeb oWebsite = oSiteCollection.OpenWeb("Website_URL"))
{
using(SPWeb oWebsiteRoot = oSiteCollection.RootWeb)
{
...
}
}
}
Wednesday, February 25, 2009
Tuesday, February 17, 2009
SP JS
<script type="text/javascript" language="javascript">
function PreSaveAction()
{
var date1 = getFieldAttribute("INPUT","DateTimeFieldDate","Start Time");
var date2 = getFieldAttribute("INPUT","DateTimeFieldDate","End Time");
var arrDate1 = date1.value.split("/");
var useDate1 = new Date(arrDate1[2], arrDate1[1]-1, arrDate1[0]);
var arrDate2 = date2.value.split("/");
var useDate2 = new Date(arrDate2[2], arrDate2[1]-1, arrDate2[0]);
if(useDate1 > useDate2)
{
alert("Please select valid End Date");
return false; // Cancel the item save process
}
return true; // OK to proceed with the save item
}
function getFieldAttribute(tagName, identifier, title)
{
var len = identifier.length;
var tags = document.getElementsByTagName(tagName);
for (var i=0; i < tags.length; i++)
{
var tempString = tags[i].id;
if (tags[i].title == title && (identifier == "" || tempString.indexOf(identifier) == tempString.length - len))
return tags[i];
}
}
</script>
<script type="text/javascript" language="javascript">
function makeReadOnly()
{
var firstName = document.getElementById("urn:schemas-microsoft-com:office:office#FirstName");
var elements = document.body.getElementsByTagName("*");
for(index=0; index<elements.length; ++index)
{
if(elements[index].title == "Title")
{
elements[index].readOnly = true;
alert("Title");
}
}
}
_spBodyOnLoadFunctionNames.push("makeReadOnly()");
</script>
HCFPT-K86VV-DCKH3-87CCR-FM6HW
Thursday, January 1, 2009
Custom Field Type Definition
A field type definition is an XML file named on the pattern fldtypes*.xml that is deployed to the C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML. The field types that ship with Windows SharePoint Services 3.0 are located in the FLDTYPES.XML file. A field definition file contains the information that Windows SharePoint Services needs to correctly render the field, including its column header, on a list view page (such as AllItems.aspx). It also typically provides information used to render the field on the view list item page (such as DispForm.aspx). The name and description of the field type, as it appears on such UI pages as the Customize [list] page, the New Site Column, and the Create Column pages, is also configured in the field type definition. Most importantly, the definition contains information about the assembly that contains the compiled field type.
Most field type properties are required by virtually any field type, such as the name and description properties. But a field type definition can also declare and define special properties of the field type that are relevant only to columns made from fields of that particular type. These are called variable field type properties. The values of these properties are set whenever a column is created based on the field type.
In order to recognize a custom field type, Windows SharePoint Services 3.0 must have a field type definition in a fldtypes*.xml file. You create these files in Microsoft Visual Studio as part of a custom field type project. For example, if you had a field type definition for a field type that defined an American Social Security number, you might name the XML file fldtypes_ssn_MyCompany.xml.
Field Types Definition Example
The following example defines two custom field types.
SocialSecurityNumber
Text
Social Security Number
Social Security Number (123456789, 123-45-6789)
TRUE
AdventureWorks.FieldTypes.SSNField, AdventureWorks.FieldTypes,
Version=1.0.0.0,Culture=neutral,PublicKeyToken=90734cc53324b79c
USAddress
MultiColumn
US Address
US Address(12345 NE 123 St. Redmond, WA 98052)
TRUE
AdventureWorks.FieldTypes.USAddressField, AdventureWorks.FieldTypes,
Version=1.0.0.0,Culture=neutral,PublicKeyToken=90734cc53324b79c
MaxLength="50" DisplaySize="15" Type="Text">
Redmond
MaxLength="2" DisplaySize="2" Type="Text">
WA
DisplaySize="5" Type="Text">
98052
]]>
Most field type properties are required by virtually any field type, such as the name and description properties. But a field type definition can also declare and define special properties of the field type that are relevant only to columns made from fields of that particular type. These are called variable field type properties. The values of these properties are set whenever a column is created based on the field type.
In order to recognize a custom field type, Windows SharePoint Services 3.0 must have a field type definition in a fldtypes*.xml file. You create these files in Microsoft Visual Studio as part of a custom field type project. For example, if you had a field type definition for a field type that defined an American Social Security number, you might name the XML file fldtypes_ssn_MyCompany.xml.
Field Types Definition Example
The following example defines two custom field types.
AdventureWorks.FieldTypes.SSNField, AdventureWorks.FieldTypes,
Version=1.0.0.0,Culture=neutral,PublicKeyToken=90734cc53324b79c
AdventureWorks.FieldTypes.USAddressField, AdventureWorks.FieldTypes,
Version=1.0.0.0,Culture=neutral,PublicKeyToken=90734cc53324b79c
]]>
Subscribe to:
Posts (Atom)