cipriangrosu.blogspot.com
CipG Development Blog: May 2009
http://cipriangrosu.blogspot.com/2009_05_01_archive.html
Only life is important. Wednesday, May 20, 2009. Different behavior in New and Edit form for a custom field. A request from a client was to create a custom field for a SharePoint list with different behavior in New form than in Edit. I was able to control this using JavaScript and the only thing left to do is to know in which form the field is rendered. For this I had to override the RenderFieldForInput. Method provided by BaseFieldControl. Class and check the SPControlMode. PathToScript = ( this. I had ...
cipriangrosu.blogspot.com
CipG Development Blog: CRUD sample for list items using WCF data services and SPLINQ
http://cipriangrosu.blogspot.com/2010/10/crud-sample-for-list-items-using-wcf.html
Only life is important. Thursday, October 21, 2010. CRUD sample for list items using WCF data services and SPLINQ. We have to be aware that the REST based access is not supported for external lists. For this example I created a custom list of towns that we will use. To this list I add some columns like Country, Population and Website. I also add some data. Now, knowing that the data services are located in the “ vti bin. 8221; directory and is called “ ListData.svc. We will create a new TownsItem. To rea...
cipriangrosu.blogspot.com
CipG Development Blog: February 2009
http://cipriangrosu.blogspot.com/2009_02_01_archive.html
Only life is important. Wednesday, February 4, 2009. Binding TreeView to Xml. If we want to display hierarchical data we have the possibility to use binding to an asp TreeView. To do this all we need to do is to set the DataSource. Property of the TreeView. Control to the data source, and then call the DataBind. Method. In our case the data source is a xml file that can look like this:. The result that we want should look like this :. A tree for car classification:. Sender, EventArgs e).
cipriangrosu.blogspot.com
CipG Development Blog: December 2008
http://cipriangrosu.blogspot.com/2008_12_01_archive.html
Only life is important. Wednesday, December 31, 2008. Lookup column - get data from parent list. In my previous post I shared a solution to replace in the CAML schema of a lookup field the GUID of the list from which the field get his data. Now the situation is that we want to get data from the parent list. Of cource that we can use the previous way but for this case there is a more easy way. The only thing we have to do is to specify the value of the List attribute to Self. Here is the code:. We have a ...
cipriangrosu.blogspot.com
CipG Development Blog: June 2009
http://cipriangrosu.blogspot.com/2009_06_01_archive.html
Only life is important. Thursday, June 25, 2009. Redirect to list item page knowing only item id, list id and web id. Is never to late to learn something new and useful. My situation was that I had to open a list item page knowing only the ids of the item, the item container (list in my case) and web. Searching on the net I did not found what I needed. This was until a colleague told me about CopyUtil. Page from SharePoint and indeed I found a very interesting article from Jan Tielen. With a distinct id.
cipriangrosu.blogspot.com
CipG Development Blog: February 2010
http://cipriangrosu.blogspot.com/2010_02_01_archive.html
Only life is important. Tuesday, February 16, 2010. Remove web part from web part gallery. Sometimes you need to prevent users to add your web part to pages. You can do this simple when deactivate a feature. Removing the web part is based on assembly name. AssemblyName = System.Reflection.Assembly.GetExecutingAssembly().FullName;. SPSite site = (SPSite)properties.Feature.Parent). SPWeb web = (SPWeb)site.OpenWeb(). SPList list = site.GetCatalog(SPListTemplateType.WebPartCatalog);. Monday, February 8, 2010.
cipriangrosu.blogspot.com
CipG Development Blog: Week range knowing week number
http://cipriangrosu.blogspot.com/2010/10/week-range-knowing-week-number.html
Only life is important. Thursday, October 21, 2010. Week range knowing week number. In one of my applications I needed to display the range of a week knowing only the week number from a specific year. After I realize that a functionality like this is not provided out of the box I had to do some research. I started with a DateTime. Extension that I founded at http:/ stackoverflow.com/questions/38039/how-can-i-get-the-datetime-for-the-start-of-the-week. DateTime dt, DayOfWeek startOfWeek). Diff = 7;. ShowS...
cipriangrosu.blogspot.com
CipG Development Blog: April 2009
http://cipriangrosu.blogspot.com/2009_04_01_archive.html
Only life is important. Monday, April 6, 2009. Yes, there is a bug on this function allowing that the field created using this function to have after creation as InternalName the DisplayName. This can cause problems when you ranslate your field name into other languages. In this case when you will try to access your field an error will occure. SetTheProperGUID(SPList catList, SPField catField, SPList pageLibList). FieldXml = catField.SchemaXml;. StrInternalName = catField.InternalName;. Regex regex = new.
cipriangrosu.blogspot.com
CipG Development Blog: October 2010
http://cipriangrosu.blogspot.com/2010_10_01_archive.html
Only life is important. Thursday, October 21, 2010. Week range knowing week number. In one of my applications I needed to display the range of a week knowing only the week number from a specific year. After I realize that a functionality like this is not provided out of the box I had to do some research. I started with a DateTime. Extension that I founded at http:/ stackoverflow.com/questions/38039/how-can-i-get-the-datetime-for-the-start-of-the-week. DateTime dt, DayOfWeek startOfWeek). Diff = 7;. ShowS...