Home - Blogs
 

 ‭(Hidden)‬ Admin Links

Welcome to RapidMind Solutions Inc. > Blogs
Blogging, simple yet profound.
Telerik RadScheduler Templates and Binding Checkboxes
So I Spend hours sifting through article after article about how to place an asp:checkbox in a telerik radscheduler template to find that there really are no good answers out there. Everyone I found were guestimations or assumptions.
 
Let me give you a hint right now.
 
It has nothing to do with Databinders, DataItems or Containers
 
Funny enough the answer was so simple it gave me a headache.
 
here is the magic.
 
asp:CheckBox
ID="chbPublic"
runat="server"
Checked='<%# Eval("publicAccess").ToString().Equals("true")?true:false %> '
 
Now read it carefully.
 
I am working in C#. Every other answer out there was in VB and did not work.
 
Eval("publicAccess").ToString().Equals("true")?true:false
 
In my case I was getting a string back true or false or null.
this covers them all.
 
for good coding practice I would recommend using a
 
     .toLower()
 
Final Version
 
Eval("publicAccess").ToString().ToLower().Equals("true")?true:false
 
Your Welcome. Enjoy
 
 
Intro to LINQ (Part 1) - Progression of the Loop

I've been asked recently to explain the advantages of using and the Extension Methods available in Visual Studio 2008 with C# 3.5.

I have trouble explaining this. It came to me as one of the "Eureka" moments. The best way for someone to learn it, is just to see it. So, I'm going to head back to my earliest memories of coding and an taste of what I see.

In introductions to programming, a simple problem is often repeated. It is probably because we see the problem in different variations constantly while coding. Given a set of data, perform an action based on each element in the set.

Specifically, I'm going to take an array of integers (1 to 10) and write each one to the console.

When I started programming, the GOSUB was not yet introduced (Yes, I learnt to program in BASIC). So to solve the problem, we coded the following logic:

Code Snippet

1:   static void GotoLoop(int[] data)
2:   {
3:  
//Initialize the loop
4: 
//Zero based Array
5: 
int currentIndex = 0;
6:  
//Or some form of terminating indicator
7: 
int end = data.Length;
8:  
//A placeholder reference for what is currently being worked on.
9: 
int currentData;

10:  
//Run the loop
11: 
start:

12:  
//Do something with current item
13: 
currentData = data[currentIndex];
14:  
Console.WriteLine(currentData);

15:  
//Finalize the loop
16: 
currentIndex++;

17:  
//Run Gaurd statement
18: 
if (currentIndex < end) {
19:  
goto start;
20:   }
21:   }

</PRE< DIV>

 

Looking at the code, it seems a wonder anyone ever got anything done. That's a lot of plumbing to repeat a single action. Let alone the potential spots for errors. It is step for step (or as close as I was going to produce for this post) what instructions the computer is going to use to handle this problem.

To mitigate some of the plumbing problems, language designers create a new syntax for this issue. The For Loop:

Code Snippet

1:   static void ForLoop(int[] data)
2:   {
3:  
//Or some form of terminating indicator
4: 
int end = data.Length;
5:  
//Or some form of terminating indicator
6: 
int currentData;

7:  
//Zero based Array
8: 
//Run Gaurd statement
9: 
//Finalize the loop
10: 
for (int currentIndex = 0; currentIndex < end; currentIndex++)
11:   {
12:  
//Do something with current item
13: 
currentData = data[currentIndex];
14:  
Console.WriteLine(currentData);
15:   }
16:   }
</PRE< DIV>

 

Same amount of logic, same potential for errors. However, here the code groups the code required to enumerate the array is placed all in the same line, creating a separation of logic. This makes diagnosing and finding bugs easier.

Along with the advances in OOP, the idea of encapsulation came along. So a few new ways of limiting this came about. An Iterator interface was created to wrap data structure like array, with methods hasNext and Next to eliminate much of the plumbing from the code.

This expanded into an System.Collections.IEnumerable interface which allows a new construct of the ForEach statement.

Code Snippet

1:   static void ForEachLoop(int[] data)
2:   {
3:  
foreach (int currentData in data)
4:   {
5:  
//Do something with current item
6: 
Console.WriteLine(currentData);
7:   }
8:   }
</PRE< DIV>

 

So now, we've gone from 18 line function to a 6 line function. So this is a built-in syntax that allows for much more abstraction, more power per command.

Now, what about commands not built into the language? Wouldn't it be nice if you build a method like:

Code Snippet

1:   data.ForEach(Console.WriteLine);

</PRE< DIV>

 

Programmatically Setting permissions in SharePoint

How to Programmatically Set Permissions on Files/Folders/Lists in a SharePoint Document Library

Yep, had to figure this out since I'm still working with SharePoint stuff.  I couldn't find any "HowTo's," code samples, tricks, hints, or anything else really helpful on this.  Just a bunch of other folks attemptint to do the same thing.

 This is one of those things where the answer looks simple and seems like it should have been apparent from the start.  Alas I couldn't see it in the beginning either.

 Here's the magic code:

// get a reference to the folder (this assumes path points to a valid folder)

SPFolder folder = SharePointConfiguration.Site.GetFolder(path);

 

// get a reference to the Sharepoint group collection

SPGroupCollection spc = SharePointConfiguration.Site.SiteGroups;

 

// get a reference to the group who’s permissions you want to modify for the folder above

SPGroup group = spc[groupName];

 

// create a role assignment from the group reference

SPRoleAssignment roleAssignment = new SPRoleAssignment((SPPrincipal)group);

 

// break role inheritance for folders/files because they will be having permissions separate from their parent file/folder

folder.Item.BreakRoleInheritance(true);

 

// update the role assignments for the group by adding the permissionSet “TestPermissionLevel” which is a custom

// permissionset I created manually…you can easily use any of the built-in permission sets

roleAssignment.RoleDefinitionBindings.Add(SharePointConfiguration.Site.RoleDefinitions["Test Permission Level"]);

 

// apply the new roleassignment to the folder.  You can do this at the listitem level if desired (i.e. this could be SPfile.Item…. instead of SPFolder.Item)

folder.Item.RoleAssignments.Add(roleAssignment);

 

Original Article - http://blogs.msdn.com/robgruen/archive/2007/11/15/how-to-programmatically-set-permissions-on-files-folders-in-a-sharepoint-document-library.aspx

Telerik RadScheduler Causing jScript Error 'Object Required' Solution
When using a Telerik RadScheduler and you recieve a jScript Error stating 'Object Required'
 
The short and simple version of the answer.
 
1) Make sure you have your Script Manager at the top of the page immediately after the opening Form Tag.
 
2) Place a Div or Panel on the page with an ID and with attribute runat='Server'
 
3) Create your Telerik.Radscheduler in code and add it to the controls collection of your place holder.
 
This is the Solution that worked for us.
If you have any comments on this please post them. We love to hear from others.
 
RapidMind Solutions Dev Team
HowTo - Show a List of Blog items
Believe it or not the SharePoint ContentQuery Webpart, which is designed to display lists of information from our selected sources will not display a list of Blog entries. That is to say that it will not display it with out some simple modifications.
 
My first project, in which I had to learn this little trick, was to make a straight forward list of our blogs, on our home page.
 
Easy right? Ha ha. It is now that I know how. Follow these steps and you will be one step closer to having that site you have always wanted. (Or some other fun phrase there you like.)
 
1) Step one
 
open your site in Sharepoint Designer.
Locate this file and check it out.
 
Style Library > XSLStyleSheets > ItemStyle.xsl
 
2) Step Two
 
Go to the end of the file before the very last </xsl:stylesheet> Tag and insert the following definition.
 
********************************************
 
<xsl:template name="ListofBlogPosts" match="Row[@Style='ListofBlogPosts']" mode="itemstyle">
  <xsl:variable name="SafeLinkUrl">
            <xsl:call-template name="OuterTemplate.GetSafeLink">
                <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
            </xsl:call-template>
        </xsl:variable>
        <xsl:variable name="SafeImageUrl">
            <xsl:call-template name="OuterTemplate.GetSafeStaticUrl">
                <xsl:with-param name="UrlColumnName" select="'ImageUrl'"/>
            </xsl:call-template>
        </xsl:variable>
        <xsl:variable name="DisplayTitle">
            <xsl:call-template name="OuterTemplate.GetTitle">
                <xsl:with-param name="Title" select="@Title"/>
                <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
            </xsl:call-template>
        </xsl:variable>
        <xsl:variable name="LinkTarget">
            <xsl:if test="@OpenInNewWindow = 'True'" >_blank</xsl:if>
        </xsl:variable>
        <div id="linkitem" class="item">
            <xsl:if test="string-length($SafeImageUrl) != 0">
                <div class="image-area-left">
                    <a href="{$SafeLinkUrl}" target="{$LinkTarget}">
                        <img class="image" src="{$SafeImageUrl}" alt="{@ImageUrlAltText}" />
                    </a>
                </div>
            </xsl:if>
            <div class="link-item">
             <xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>    
               
                <!-- Anonymous Freindly Link code -->
                <xsl:text disable-output-escaping="yes"><![CDATA[<a href="http://***YourURL.com***/Blogs/Lists/Posts/Post.aspx?ID=]]></xsl:text>
    <xsl:value-of select="@ID"/>
    <xsl:text disable-output-escaping="yes"><![CDATA[" Target="_self">]]></xsl:text>
    <xsl:value-of select="$DisplayTitle"/>
    <xsl:text disable-output-escaping="yes"><![CDATA[</a>]]></xsl:text>
    <!-- End Anonymous Freindly Link code -->
    
                <div class="description">
                    <xsl:value-of select="@Description" />
                </div>
            </div>
        </div>
    </xsl:template>
 
 
 
********************************************
 
3) Step three
 
Make sure you replace the Url "***YourURL.com***/Blogs" with the URL of your blog site.
 
then save the file and check in the changes.
 
4) Step four
 
On the page that you want to put your new list. Insert a ContentQuery WebPart.
 
On the menu for the webPart. (The edit link in the top right hand corner of the Webpart) Select "Modify shared webpart"
 
once the properties open on the right hand side of the page.
 
Select "Show items from the following lists" to "yourSiteName/Posts"
 
example "Blogs/Posts"
 
Now expand the presentation section using the + sign and under "Styles" change "ItemStyle" to "ListOfBlogPosts"
 
Save your changes, publish your page and enjoy your new list.
 
**PS.. Be sure to tune in next week when we'll here someone say "But it works on my computer! Grrrrrrr."
 
David Sullivan
Sharepoint Consultant
HowTo - Custom Theme

The easiest and the fastest way to apply the same look and feel on any SharePoint site is creating a site theme. A SharePoint site theme basically consists of theme.inf, theme.css, and image files. Theme.inf file simply represents the title of the theme. Theme.css is a stylesheet file that defines colors, header images and layouts of a site and image files can be referenced here to display on the page. By creating a custom site theme, you can easily change the style but in fact, writing and editing the stylesheet can be somewhat chanllenging when you have more than a hundred of elements to deal with.

Here is a short procedure of creating a custom site theme named "Ghost":

1. Copy any theme folder in "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\THEMES" folder and paste with its name replaced with "Ghost". In this example, copy GRANITE folder.

2. In Ghost folder, rename GRANITE.INF file to GHOST.INF in upper case.

3. Open GHOST.INF file with notepad.

4. Change the value of title under [Info] to Ghost.

5. Replace every word, Granite, under [titles] with Ghost.

6. Open "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033\SPTHEMES.XML" file with notepad.

7. Add the following lines under <SPThemes> tag:
 <Templates>
  <TemplateID>Ghost</TemplateID>
  <DisplayName>Ghost</DisplayName>
  <Description>Ghost theme.</Description>
  <Thumbnail>images/thghost.gif</Thumbnail>
  <Preview>images/thghost.gif</Preview>
 </Templates>
Notice that preview and thumbnail paths are images/thghost.gif. By default, MOSS 2007 and WSS 3.0 will not have such image files.

8. In order to display thumbnail and preview correctly, you will need to capture the screen and save the file in "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\IMAGES" folder with thghost.gif name. You can change the .gif file name if you change the thumbnail and preview file names in <Templates> tag.

9. Do an iisrest for the server to recognize the new theme.

Pretty simple procedure. Now you are ready to test your new theme. In Site Settings, you can now choose Ghost theme; however, the theme will not differ from Granite theme. Now, it is time for you to play with theme.css file!

original Post - http://www.sharepointblogs.com/tigirry/archive/2007/07/03/custom-site-theme-for-sharepoint-2007-moss-2007-and-wss-3-0.aspx
Sharepoint - What is it? How can it help me?

How did sharepoint come to be?

      Over the years, people studying trends in business needs, have noticed a few very interesting facts.  Fact, no matter how many times you try to reinvent the wheel, you still end up with a wheel. Now what do I mean by that? I'm glad you asked. Over the years, multitudes of designers and developers have created millions of software packages and programs.  Almost every one has something in common.  They have all been designed with the intention to make human communications better.  Now over time, many of these developers discovered that there are only a few communication issues that everyone repeatedly tries to solve.   Recognizing this, they decided to design a package that focuses directly on the key elements that businesses need for better internal and external communications.

 

What is SharePoint?

     SharePoint is the next Generation in communications. Essentially, SharePoint is a web server system bundle. SharePoint is a collection of the most commonly used and requested Preconfigured webSites. Combining knowledge and experience from generations of Team Systems, hosting Systems, and web design systems Microsoft has created the incredibly useful and flexible System known as "SharePoint". As the name implies "Share" "Point" is a server that allows you to easily share information, internally on an intranet, or externally through an Extranet. Unlike earlier system where you needed developers to build fancy systems, sharepoint is user driven. You the end user can immediately start adding content, editing styles and effecting change on your new sharepoint system without having to depend on programmers to make changes for you.

 

How can SharePoint benefit me?

     SharePoint is designed around a few key principles. These are what I believe to be the most important points.

 

SharePoint is designed to be ready out of the box
having preconfigured working sites that handle most of your business needs built right in means your (From start to finish) times are incredibly fast. Development is minimal with proper SharePoint Architecture. (General SharePoint development should be 10% development and 90% configuration.)

 

SharePoint puts the controls in your hands.
     We are so accustomed to webPages being these static visual items that require phone calls and technicians to manipulate. SharePoint has incorporated the design tools right into the webPages. If you log in with proper credentials and have the appropriate permissions you can create new pages, edit content and manipulate your site directly from the webPage. It can be as easy as typing a letter.

 

Documents can now be shared, read, edited, versioned and managed.
     Recognizing that documents are an important part of every business; SharePoint allows us to have online libraries and storage areas for everyday documents, images and other various files. Need to maintain a collection of invoices, contracts, stories or any other document. No problem, this is what sharepoint does best. Better yet would you like to have sharepoint enforce some rules about certain documents? It can do that as well. Using workflow sharepoint makes sure your documents follow the necessary paths to completion.

 

Security at its finest!

     By using secured credentials sharepoint manages security at all levels. Every step in a SharePoint Application requires some form of security level. When designing your SharePoint Solution you will designate Public areas and Private areas. Even the private sections will have sub levels of privacy allowing you total control over who controls what in your SharePoint System.

Conclusion
     From start to finish SharePoint is drastically changing the way people us the internet technologies. Using templates and premade systems developers can create dynamic and interactive Company Sites in a fraction of the amount of time. Companies can now instantly correct or modify their own pages right from the desktop. Through SharePoint's predesigned team sites, wiki sites and blog sites companies can communicate between offices, branches even countries better than ever before. From the smallest family Store to the Largest International conglomerate sharepoint can increase your internet presence and help your internal communications immensely.

 

     In my opinion SharePoint can help anyone that has to communicate with co-workers and or clients. I know that's a pretty broad statement; however SharePoint can do so much for so many. After all it is the fastest growing product Microsoft has ever produced, with over 75 Million Licenses purchased already.

 

David Sullivan

Developer and Consultant.

Digsby - The Messenger Replacement that does it all.
Ok. So we all know what it is like to have 2 or 3 email accounts, 2 or 3 IM accounts, facebook, mySpace and countless other things that we use for communication.  Thanks to Tyler and his never ending Quest for awesome technology we now have a new IM Program that does everything but the dishes.
 
Imagine having all your emails, IMs, Facebook updates, Twitters and many more all coming to one nice little IM Program in your tool bar. Now you can.
 
This little program can help us all be more professional by putting all your communications to work for you. Now responding in a timely manner is easier than ever. Never miss another email, tweet, status update or message again.
 

It is called Digsby

 
you can download it completely free from
 
 
Try it. like it, love it.

 Latest Blogs ...