1. Open the Infopath Form in Design mode.
2. Click on "Save as Source Files..." from File menu.
3. Go to the folder where Source files are stored.
4. Open the xsl file for which you want to display hand icon on buttons.(Note that it ill create an xsl file for each view of the infopath form).
5. Search for the button with "type="button" in search criteria
6. For that button style add "CURSOR: pointer;".
Ex:
input class="langFont" title="" style="BORDER-RIGHT: #cbd8eb 1pt solid; BORDER-TOP: #000000 1pt; FONT-WEIGHT: bold; FONT-SIZE: xx-small; BORDER-LEFT: #cbd8eb 1pt solid; WIDTH: 82px; COLOR: #ffffff; BORDER-BOTTOM: #000000 1pt; HEIGHT: 17px; BACKGROUND-COLOR: #00003c; CURSOR: pointer;" type="button" size="1" value="Close" xd:CtrlId="BtnClose" xd:xctname="Button"
7. Save the file.
8. Next publish the manifest file(manifest.xsf) to the Sharepoint library.
9. Now if you open the infopath file and mouse over the button, it will display hand icon instead of pointer.
Monday, February 01, 2010
Wednesday, November 04, 2009
Programatically checking if the file exists in the specified location in Sharepoint
SPSite Site = new SPSite(SITE_URL);
SPWeb Web = Site.OpenWeb();
Bool isFileExists;
if(Web.GetFile(FilePath).Exists)
isFileExists = true;
else
isFileExists = false;
SPWeb Web = Site.OpenWeb();
Bool isFileExists;
if(Web.GetFile(FilePath).Exists)
isFileExists = true;
else
isFileExists = false;
Method for converting a number to base in C#.net
public static string ConvertToBase(int num, int nbase)
{
String chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
// check if we can convert to another base
if (nbase <> chars.Length)
return "";
int r;
String newNumber = "";
// in r we have the offset of the char that was converted to the new base
while (num >= nbase)
{
r = num % nbase;
newNumber = chars[r] + newNumber;
num = num / nbase;
}
// the last number to convert
newNumber = chars[num] + newNumber;
return newNumber;
}
{
String chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
// check if we can convert to another base
if (nbase <> chars.Length)
return "";
int r;
String newNumber = "";
// in r we have the offset of the char that was converted to the new base
while (num >= nbase)
{
r = num % nbase;
newNumber = chars[r] + newNumber;
num = num / nbase;
}
// the last number to convert
newNumber = chars[num] + newNumber;
return newNumber;
}
Regular Expression for Validating Email
^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$
How to Clone List in C#.net
To Copy List1 to List 2;
List List1;
//Create an array of strings
string[] arrStrList=new string[List1.Count];
//Copy the List to array of strings
List1.CopyTo(arrStrList);
//Define a new list
List List2= new List(List1.Count);
//Add array of strings to new list
List2.AddRange(arrStrList);
List
//Create an array of strings
string[] arrStrList=new string[List1.Count];
//Copy the List to array of strings
List1.CopyTo(arrStrList);
//Define a new list
List
//Add array of strings to new list
List2.AddRange(arrStrList);
How to read and update LookUp Field in Sharepoint
//To Read LookUp Field
public static string ReadLookupValue(SPListItem item, string columnName)
{
SPFieldLookupValue lookupField = new SPFieldLookupValue(item[columnName].ToString());
return lookupField.LookupValue;
}
//To Update LookUp Field
int ListItemID = GetListItemID("ListWithLookUpColumn","ValueToBeUpdate");
ListItem[LookUpFieldColumnName] = ListItemID;
ListItem.Update();
/////
public static int GetListItemID(string ListName, string ListColumnValue)
{
int ListItemID=0;
try
{
SPSite Site = new SPSite(SITE_URL);
SPWeb Web = Site.OpenWeb();
SPList List = Web.Lists[ListName];
SPListItemCollection ListItems = List.Items;
int ListItemCount = ListItems.Count;
for (int i = 0; i < ListItemCount; i++)
{
SPListItem ListItem = ListItems[i];
if (ListItem["Title"].ToString() == ListColumnValue)
{
ListItemID =Convert.ToInt32(ListItem["ID"].ToString());
break;
}
}
return ListItemID;
}
catch (Exception ex)
{
return 0;
}
}
public static string ReadLookupValue(SPListItem item, string columnName)
{
SPFieldLookupValue lookupField = new SPFieldLookupValue(item[columnName].ToString());
return lookupField.LookupValue;
}
//To Update LookUp Field
int ListItemID = GetListItemID("ListWithLookUpColumn","ValueToBeUpdate");
ListItem[LookUpFieldColumnName] = ListItemID;
ListItem.Update();
/////
public static int GetListItemID(string ListName, string ListColumnValue)
{
int ListItemID=0;
try
{
SPSite Site = new SPSite(SITE_URL);
SPWeb Web = Site.OpenWeb();
SPList List = Web.Lists[ListName];
SPListItemCollection ListItems = List.Items;
int ListItemCount = ListItems.Count;
for (int i = 0; i < ListItemCount; i++)
{
SPListItem ListItem = ListItems[i];
if (ListItem["Title"].ToString() == ListColumnValue)
{
ListItemID =Convert.ToInt32(ListItem["ID"].ToString());
break;
}
}
return ListItemID;
}
catch (Exception ex)
{
return 0;
}
}
Programatically Sending Mails only to Outlook users and not sending to out side emails like Gmail,Yahoo etc.
I faced a problem in sending mails to outside of our domain.
I figured it out that i missed to add the following line of code before sending mail.
SmtpMail.SmtpServer = "EmailServername".
I figured it out that i missed to add the following line of code before sending mail.
SmtpMail.SmtpServer = "EmailServername".
Subscribe to:
Posts (Atom)