<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Code For Future &#187; reusable code</title>
	<atom:link href="http://codeforfuture.com/category/reusable-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://codeforfuture.com</link>
	<description>Share as you code.</description>
	<lastBuildDate>Sun, 18 Jul 2010 05:30:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>using RichTextBox control in Sharepoint MOSS 2007</title>
		<link>http://codeforfuture.com/2008/12/03/using-richtextbox-control-in-sharepoint-moss-2007/</link>
		<comments>http://codeforfuture.com/2008/12/03/using-richtextbox-control-in-sharepoint-moss-2007/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 05:26:00 +0000</pubDate>
		<dc:creator>Jayvardhan Patil</dc:creator>
				<category><![CDATA[MOSS 2007]]></category>
		<category><![CDATA[reusable code]]></category>

		<guid isPermaLink="false">http://codeforfuture.com/2008/12/03/using-richtextbox-control-in-sharepoint-moss-2007/</guid>
		<description><![CDATA[Like me you too came searching for the RichTextField control for SharePoint. But you will be surprised that this is not the one you are looking for. 
You must be looking for a control which will allow you to create formatted text as shown in below given image.

InputFormTextBox is the correct control you will ever [...]]]></description>
			<content:encoded><![CDATA[<p>Like me you too came searching for the RichTextField control for SharePoint. But you will be surprised that this is not the one you are looking for. </p>
<p>You must be looking for a control which will allow you to create formatted text as shown in below given image.</p>
<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_xm5KTL2VzWo/STYs3UcFCiI/AAAAAAAABCI/sFgFuNTju3A/s1600-h/InputFormTextBox+Control.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 337px; height: 163px;" src="http://3.bp.blogspot.com/_xm5KTL2VzWo/STYs3UcFCiI/AAAAAAAABCI/sFgFuNTju3A/s400/InputFormTextBox+Control.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5275453342402021922" /></a></p>
<p>InputFormTextBox is the correct control you will ever need. This is available under Microsoft.SharePoint.WebControls namespace. (Only MOSS 2007)</p>
<p>How to use it? Very simple.</p>
<blockquote><p>InputFormTextBox richMessage = new InputFormTextBox();<br />richMessage.RichText = true;<br />richMessage.RichTextMode = SPRichTextMode.FullHtml;</p></blockquote>
<p>You may also use following useful properties:</p>
<blockquote><p>richMessage.AllowHyperlink = true;<br />richMessage.TextMode = TextBoxMode.MultiLine;<br />richMessage.Wrap = true;<br />richMessage.Rows = 10;<br />richMessage.Width = System.Web.UI.WebControls.Unit.Percentage(100);</p></blockquote>
<p>Check another thread for known issues with InputFormTextBox Control.<br /><a href="http://code.jaypatil.com/2008/12/inputformtextbox-width-enabled-readonly.html">InputFormTextBox width, Enabled, ReadOnly Properties not working properly</a><br />
<br/><br />
<span style="font-weight:bold;"><br />
If you found this post helpful then please share it.<br />
</span></p>
<p><a href="http://hub.tm/?IgjDe"><br />
<img border="0" target="_new" src="http://twitter.grader.com/assets/img/tweet-it-button.jpg" alt="TweetIt from HubSpot" title=""/><br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://codeforfuture.com/2008/12/03/using-richtextbox-control-in-sharepoint-moss-2007/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Collection was modified; enumeration operation may not execute</title>
		<link>http://codeforfuture.com/2008/12/01/collection-was-modified-enumeration-operation-may-not-execute/</link>
		<comments>http://codeforfuture.com/2008/12/01/collection-was-modified-enumeration-operation-may-not-execute/#comments</comments>
		<pubDate>Mon, 01 Dec 2008 12:35:00 +0000</pubDate>
		<dc:creator>Jayvardhan Patil</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[MS.NET]]></category>
		<category><![CDATA[reusable code]]></category>

		<guid isPermaLink="false">http://codeforfuture.com/2008/12/01/collection-was-modified-enumeration-operation-may-not-execute/</guid>
		<description><![CDATA[Collection was modified; enumeration operation may not execute
This exception is thrown when you are trying to delete items of a collection in a for loop or using a for each loop.
The ideal solution could be to use a for loop with a descending counter.
Problem:
for e.g. 
If suppose you are executing any of following code snippets
1.
for [...]]]></description>
			<content:encoded><![CDATA[<p>Collection was modified; enumeration operation may not execute</p>
<p>This exception is thrown when you are trying to delete items of a collection in a for loop or using a for each loop.</p>
<p>The ideal solution could be to use a for loop with a descending counter.</p>
<p>Problem:</p>
<p>for e.g. </p>
<p>If suppose you are executing any of following code snippets</p>
<p>1.</p>
<p>for (int listcounter = 0; listcounter < ReferenceOwnersList.Items.Count; listcounter++)<br />{<br /> ReferenceOwnersList.Items.Delete(0);<br />}</p>
<p>2.</p>
<p>foreach (SPListItem Li in ReferenceOwnersList.Items)<br />{<br /> Li.Delete();<br />}</p>
<p>Here ReferenceOwnersList is a collection.</p>
<p>Now whenever this code will execute for the first time, the number of items reduce. So the second item gets the first index.<br />I tried deleting 0th item everytime but still I got the exception. Again changing index may cause skipping the items in most senerios.</p>
<p>And the collection throws the &#8220;Collection was modified; enumeration operation may not execute&#8221; exception.</p>
<p>Solution:</p>
<p>Solution <br />Use a reducing for loop.</p>
<p>for (int cntLi = ReferenceOwnersList.Items.Count &#8211; 1; cntLi >=0 ;cntLi &#8212; )<br />{<br /> ReferenceOwnersList.Items.Delete(cntLi);<br />}</p>
<p>so that even if the last item is deleted, the index of other items wont change.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeforfuture.com/2008/12/01/collection-was-modified-enumeration-operation-may-not-execute/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Welcome</title>
		<link>http://codeforfuture.com/2008/06/25/welcome/</link>
		<comments>http://codeforfuture.com/2008/06/25/welcome/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 12:37:00 +0000</pubDate>
		<dc:creator>Jayvardhan Patil</dc:creator>
				<category><![CDATA[reusable code]]></category>

		<guid isPermaLink="false">http://codeforfuture.com/2008/06/25/welcome/</guid>
		<description><![CDATA[Hi,
I&#8217;m Jay. Welcome to my blog. I have created this blog to share my experiences while working on different technologies.
The theme for this blog is &#8220;Coding for future&#8221;.
Coding for future is all about reducing the time required for software development.
The ways I have figured out is;
Building reusable code, and making it public!
Though practically exposing code [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>I&#8217;m Jay. Welcome to my blog. I have created this blog to share my experiences while working on different technologies.</p>
<p>The theme for this blog is &#8220;Coding for future&#8221;.</p>
<p>Coding for future is all about reducing the time required for software development.</p>
<p>The ways I have figured out is;</p>
<p>Building reusable code, and making it public!</p>
<p>Though practically exposing code could be harmful to some organizations, programmers can sharing technical issues faced and their solutions!</p>
<p>I believe if 80% of the issues and solutions are shared then we will see a rapid application development and we will soon be building more complex solutions that world is actually going to see may be 50 years later.</p>
<p>This is &#8220;coding for future&#8221; all about!.</p>
]]></content:encoded>
			<wfw:commentRss>http://codeforfuture.com/2008/06/25/welcome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
