<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Rakesh Bajania&#039;s Blog</title>
	<atom:link href="http://rakeshbajania.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://rakeshbajania.wordpress.com</link>
	<description></description>
	<lastBuildDate>Mon, 26 Dec 2011 04:16:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='rakeshbajania.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Rakesh Bajania&#039;s Blog</title>
		<link>http://rakeshbajania.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://rakeshbajania.wordpress.com/osd.xml" title="Rakesh Bajania&#039;s Blog" />
	<atom:link rel='hub' href='http://rakeshbajania.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Change RadWindow&#8217;s Title from Javascript or from Client-side</title>
		<link>http://rakeshbajania.wordpress.com/2011/05/24/change-radwindow-title-run-time-from-javascript-or-client-side/</link>
		<comments>http://rakeshbajania.wordpress.com/2011/05/24/change-radwindow-title-run-time-from-javascript-or-client-side/#comments</comments>
		<pubDate>Tue, 24 May 2011 11:27:56 +0000</pubDate>
		<dc:creator>rakeshbajania</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Telerik]]></category>
		<category><![CDATA[Change RadWindow Title from Client-side]]></category>
		<category><![CDATA[Change RadWindow Title from Javascript]]></category>
		<category><![CDATA[Change RadWindow Title from Javascript or Client-side.]]></category>
		<category><![CDATA[Change RadWindow Title Run-time from Client-side.]]></category>
		<category><![CDATA[Change RadWindow Title Run-time from Javascript]]></category>
		<category><![CDATA[Change RadWindow Title Run-time from Javascript or Client-side.]]></category>
		<category><![CDATA[Set RadWindow Title from Client-side]]></category>
		<category><![CDATA[Set RadWindow Title from Javascript]]></category>
		<category><![CDATA[Set RadWindow Title from Javascript or Client-side]]></category>
		<category><![CDATA[Set RadWindow Title Run-time at Client-side]]></category>
		<category><![CDATA[Set RadWindow Title Run-time from Javascript]]></category>
		<category><![CDATA[Set RadWindow Title Run-time from Javascript or Client-side.]]></category>

		<guid isPermaLink="false">http://rakeshbajania.wordpress.com/?p=153</guid>
		<description><![CDATA[As per my scenario, I have RadGrid which contains Add and Edit button for Adding new record and Updated existing record respectively. On click of any of these button it will open a RadWindow which contains all my page controls. And I have a requirement to set the Title of RadWindow accordinly. I mean when [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshbajania.wordpress.com&amp;blog=8194453&amp;post=153&amp;subd=rakeshbajania&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">As per my scenario, I have RadGrid which contains Add and Edit button for Adding new record and Updated existing record respectively. On click of any of these button it will open a RadWindow which contains all my page controls. And I have a requirement to set the Title of RadWindow accordinly. I mean when user click Add button at that time RadWindow&#8217;s Title should be Add Mode and for Edit button click it should be Edit Mode.</span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">And I found an easy way to set the Title of RadWindow from client-side, which I am going to share with you.</span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">On Button, I have a ClientClick() event from where I am opening RadWindow, so now I am going to pass the Mode of the RadWindow in which it is going to be opened. Say for example,</span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#ff0000;">OnClientClick</span><span style="color:#0000ff;">=&#8221;openFileBuilderDialog(&#8216;Add&#8217;);&#8221;</span></span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">Here, openFileBuilderDialog is my Javascript Function, which is shown as below.</span></span></p>
<p style="text-align:left;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"> <span style="color:#0000ff;">function</span><span style="color:#000000;"> openFileBuilderDialog(Mode) {</span></span></span></p>
<p style="text-align:left;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#0000ff;">var</span><span style="color:#000000;"> wnd = $find(</span><span style="color:#800000;">&#8216;&lt;%=RadWindow1.ClientID %&gt;&#8217;</span><span style="color:#000000;">);</span></span></span></p>
<p style="text-align:left;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#0000ff;">if</span><span style="color:#000000;"> (Mode == </span><span style="color:#800000;">&#8220;View&#8221;</span><span style="color:#000000;">) {</span></span></span></p>
<p style="text-align:left;"><span style="color:#000000;"> <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">wnd.set_title(</span><span style="color:#800000;">&#8220;View File Information&#8221;</span><span style="color:#000000;">);</span></span></span></p>
<p style="text-align:left;"><span style="color:#000000;"> <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span></span></p>
<p style="text-align:left;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#0000ff;">else</span><span style="color:#0000ff;">if</span><span style="color:#000000;"> (Mode == </span><span style="color:#800000;">&#8220;Edit&#8221;</span><span style="color:#000000;">) {</span></span></span></p>
<p style="text-align:left;"><span style="color:#000000;"> <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">wnd.set_title(</span><span style="color:#800000;">&#8220;Edit File Information&#8221;</span><span style="color:#000000;">);</span></span></span></p>
<p style="text-align:left;"><span style="color:#000000;"> <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span></span></p>
<p style="text-align:left;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#0000ff;">else</span><span style="color:#0000ff;">if</span><span style="color:#000000;"> (Mode == </span><span style="color:#800000;">&#8220;Add&#8221;</span><span style="color:#000000;">) {</span></span></span></p>
<p style="text-align:left;"><span style="color:#000000;"> <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">wnd.set_title(</span><span style="color:#800000;">&#8220;Add File Information&#8221;</span><span style="color:#000000;">);</span></span></span></p>
<p style="text-align:left;"><span style="color:#000000;"> <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span></span></p>
<p style="text-align:left;"><span style="color:#000000;"> <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">wnd.show();</span></span></span></p>
<p style="text-align:left;"><span style="color:#000000;"> <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span></span></p>
<p> <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">In this function, </span></span></p>
<ol>
<li><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">Get the RadWindow using its ClientID.</span></span></li>
<li><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">Find the current mode of the RadWindow, which I have supply on appropriate button&#8217;s onClientClick event.</span></span></li>
<li><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">Then use the &#8220;set_title&#8221; method to set the Title that we want.</span></span></li>
<li><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">And finally called, &#8220;show&#8221; method to open the RadWindow.</span></span></li>
</ol>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">That&#8217;s it.</span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">If the content page has its own title set in the @Page directive or in the &lt;head&gt; section, this title will override the RadWindow&#8217;s one. </span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">To find more methods of RadWindow and examples please follow the below link,</span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><a>http://www.telerik.com/help/aspnet-ajax/window-programming-radwindow-methods.html</a></span></span> </span></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rakeshbajania.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rakeshbajania.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rakeshbajania.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rakeshbajania.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rakeshbajania.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rakeshbajania.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rakeshbajania.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rakeshbajania.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rakeshbajania.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rakeshbajania.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rakeshbajania.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rakeshbajania.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rakeshbajania.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rakeshbajania.wordpress.com/153/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshbajania.wordpress.com&amp;blog=8194453&amp;post=153&amp;subd=rakeshbajania&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rakeshbajania.wordpress.com/2011/05/24/change-radwindow-title-run-time-from-javascript-or-client-side/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/09942868e36f7968707225d562ea2895?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rakesh.bajania</media:title>
		</media:content>
	</item>
		<item>
		<title>Export to Excel or PDF in RadGrid</title>
		<link>http://rakeshbajania.wordpress.com/2011/01/28/export-to-excel-or-pdf-in-radgrid/</link>
		<comments>http://rakeshbajania.wordpress.com/2011/01/28/export-to-excel-or-pdf-in-radgrid/#comments</comments>
		<pubDate>Fri, 28 Jan 2011 07:25:53 +0000</pubDate>
		<dc:creator>rakeshbajania</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Telerik]]></category>

		<guid isPermaLink="false">http://rakeshbajania.wordpress.com/?p=130</guid>
		<description><![CDATA[Introduction: RadGrid has a built-in facility to export the grid&#8217;s data into different formats like Excel, CSV, Word or PDF and we can export the same as per the system requierement. Here I will show you how to export grid&#8217;s data in PDF or Excel format. Code: First of all in RadGrid, place the ExportSettings [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshbajania.wordpress.com&amp;blog=8194453&amp;post=130&amp;subd=rakeshbajania&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span style="font-family:Verdana,sans-serif;"><span style="font-size:medium;">Introduction:</span></span></strong></p>
<p><span style="font-family:Verdana,sans-serif;">RadGrid has a built-in facility to export the grid&#8217;s data into different formats like Excel, CSV, Word or PDF and we can export the same as per the system requierement. Here I will show you how to export grid&#8217;s data in PDF or Excel format.</span><strong></strong></p>
<p><strong><span style="font-family:Verdana,sans-serif;"><span style="font-size:medium;">Code:</span></span></strong></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">First of all in RadGrid, place the ExportSettings tag as below in the code. Here I have set properties like IgnorePaging equal to True to export all grids data and OpenInNewWindow equal to true to open the export data in a seperate window. Also in ExportSettings section I have defined the width of the PDF page.</span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">ExportSettings</span><span style="color:#ff0000;">IgnorePaging</span><span style="color:#0000ff;">=&#8221;true&#8221;</span><span style="color:#ff0000;">OpenInNewWindow</span><span style="color:#0000ff;">=&#8221;true&#8221;&gt;</span></span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Pdf</span><span style="color:#ff0000;">PageWidth</span><span style="color:#0000ff;">=&#8221;1500px&#8221;</span><span style="color:#0000ff;">/&gt;</span></span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">ExportSettings</span><span style="color:#0000ff;">&gt;</span></span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><strong><span style="color:#000000;">Now in RadAjaxManager of your page add the following event:</span></strong></span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#ff0000;">ClientEvents-OnRequestStart</span><span style="color:#0000ff;">=&#8221;requestStart&#8221;</span></span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><strong><span style="color:#000000;">Then, add the following javascript function in your aspx page:</span></strong></span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#0000ff;">function</span><span style="color:#000000;"> requestStart(sender, args) {</span></span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#0000ff;">if</span><span style="color:#000000;"> (args.get_eventTarget().indexOf(</span><span style="color:#800000;">&#8220;btnExportToPDF&#8221;</span><span style="color:#000000;">) &gt; 0 ||</span></span></span></p>
<p><span style="color:#000000;"> <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">args.get_eventTarget().indexOf(</span><span style="color:#800000;">&#8220;btnExportToExcel&#8221;</span>) &gt; 0)</span></span></p>
<p><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"> args.set_enableAjax(</span><span style="color:#0000ff;">false</span>);</span></span></p>
<p><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#000000;">And then add the command name for the button as like following for PDF or Excel.</span></span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#ff0000;">CommandName</span><span style="color:#0000ff;">=&#8221;ExportToPdf&#8221;</span></span></span></p>
<p><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">and it&#8217;s done.</span></span></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rakeshbajania.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rakeshbajania.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rakeshbajania.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rakeshbajania.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rakeshbajania.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rakeshbajania.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rakeshbajania.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rakeshbajania.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rakeshbajania.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rakeshbajania.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rakeshbajania.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rakeshbajania.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rakeshbajania.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rakeshbajania.wordpress.com/130/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshbajania.wordpress.com&amp;blog=8194453&amp;post=130&amp;subd=rakeshbajania&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rakeshbajania.wordpress.com/2011/01/28/export-to-excel-or-pdf-in-radgrid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/09942868e36f7968707225d562ea2895?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rakesh.bajania</media:title>
		</media:content>
	</item>
		<item>
		<title>GROUPING in RadGrid</title>
		<link>http://rakeshbajania.wordpress.com/2011/01/20/grouping-in-radgrid/</link>
		<comments>http://rakeshbajania.wordpress.com/2011/01/20/grouping-in-radgrid/#comments</comments>
		<pubDate>Thu, 20 Jan 2011 10:43:34 +0000</pubDate>
		<dc:creator>rakeshbajania</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Telerik]]></category>
		<category><![CDATA[GROUPING in RadGrid Telerik]]></category>
		<category><![CDATA[RadGrid Group by]]></category>
		<category><![CDATA[RadGrid Group by on column]]></category>
		<category><![CDATA[RadGrid Grouping in Telerik]]></category>

		<guid isPermaLink="false">http://rakeshbajania.wordpress.com/?p=109</guid>
		<description><![CDATA[Introduction: RadGrid supports grouping of items based on the value of a particular column. You can even have multilevel grouping based on different criteria. To group the data in a grid, specify grouping criteria by setting the GroupByExpressions property of a table view in the grid Code: &#60;MasterTableView Width=&#8221;100%&#8221; CommandItemDisplay=&#8221;Top&#8221; GroupLoadMode=&#8221;Server&#8221; ShowGroupFooter=&#8221;true&#8221;&#62; &#60;GroupByExpressions&#62; &#60;telerik:GridGroupByExpression&#62; &#60;SelectFields&#62; &#60;telerik:GridGroupByField [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshbajania.wordpress.com&amp;blog=8194453&amp;post=109&amp;subd=rakeshbajania&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction:</strong></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:x-small;"><strong><span style="color:#000000;"><span style="font-size:small;">RadGrid</span></span></strong><span style="color:#000000;"><span style="font-size:small;"> supports grouping of items based on the value of a particular column. You can even have multilevel grouping based on different criteria.</span></span></span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">To group the data in a grid, specify grouping criteria by setting the </span></span><strong><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">GroupByExpressions</span></span></strong><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"> property of a table view in the grid</span></span></p>
<p><strong>Code:</strong></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:x-small;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">MasterTableView</span><span style="color:#000000;"> </span><span style="color:#ff0000;">Width</span><span style="color:#0000ff;">=&#8221;100%&#8221;</span><span style="color:#000000;"> </span><span style="color:#ff0000;">CommandItemDisplay</span><span style="color:#0000ff;">=&#8221;Top&#8221;</span><span style="color:#000000;"> </span><span style="color:#ff0000;">GroupLoadMode</span><span style="color:#0000ff;">=&#8221;Server&#8221;</span><span style="color:#000000;"> </span><span style="color:#ff0000;">ShowGroupFooter</span><span style="color:#0000ff;">=&#8221;true&#8221;&gt;</span></span></span></p>
<p><span style="color:#000000;"> </span><span style="font-family:Verdana,sans-serif;"><span style="font-size:x-small;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">GroupByExpressions</span><span style="color:#0000ff;">&gt;</span></span></span></p>
<p><span style="color:#000000;"> </span><span style="font-family:Verdana,sans-serif;"><span style="font-size:x-small;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">telerik</span><span style="color:#0000ff;">:</span><span style="color:#800000;">GridGroupByExpression</span><span style="color:#0000ff;">&gt;</span></span></span></p>
<p><span style="color:#000000;"> </span><span style="font-family:Verdana,sans-serif;"><span style="font-size:x-small;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">SelectFields</span><span style="color:#0000ff;">&gt;</span></span></span></p>
<p><span style="color:#000000;"> </span><span style="font-family:Verdana,sans-serif;"><span style="font-size:x-small;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">telerik</span><span style="color:#0000ff;">:</span><span style="color:#800000;">GridGroupByField</span><span style="color:#000000;"> </span><span style="color:#ff0000;">FieldAlias</span><span style="color:#0000ff;">=&#8221;Security&#8221;</span><span style="color:#000000;"> </span><span style="color:#ff0000;">FieldName</span><span style="color:#0000ff;">=&#8221;SEC_CODE&#8221;</span><span style="color:#000000;"> </span><span style="color:#ff0000;">SortOrder</span><span style="color:#0000ff;">=&#8221;Ascending&#8221;</span><span style="color:#000000;"> </span><span style="color:#0000ff;">/&gt;</span></span></span></p>
<p><span style="color:#000000;"> </span><span style="font-family:Verdana,sans-serif;"><span style="font-size:x-small;"><span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">SelectFields</span><span style="color:#0000ff;">&gt;</span></span></span></p>
<p><span style="color:#000000;"> </span><span style="font-family:Verdana,sans-serif;"><span style="font-size:x-small;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">GroupByFields</span><span style="color:#0000ff;">&gt;</span></span></span></p>
<p><span style="color:#000000;"> </span><span style="font-family:Verdana,sans-serif;"><span style="font-size:x-small;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">telerik</span><span style="color:#0000ff;">:</span><span style="color:#800000;">GridGroupByField</span><span style="color:#000000;"> </span><span style="color:#ff0000;">FieldAlias</span><span style="color:#0000ff;">=&#8221;Security&#8221;</span><span style="color:#000000;"> </span><span style="color:#ff0000;">FieldName</span><span style="color:#0000ff;">=&#8221;SEC_CODE&#8221;</span><span style="color:#000000;"> </span><span style="color:#ff0000;">SortOrder</span><span style="color:#0000ff;">=&#8221;Ascending&#8221;</span><span style="color:#000000;"> </span><span style="color:#0000ff;">/&gt;</span></span></span></p>
<p><span style="color:#000000;"> </span><span style="font-family:Verdana,sans-serif;"><span style="font-size:x-small;"><span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">GroupByFields</span><span style="color:#0000ff;">&gt;</span></span></span></p>
<p><span style="color:#000000;"> </span><span style="font-family:Verdana,sans-serif;"><span style="font-size:x-small;"><span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">telerik</span><span style="color:#0000ff;">:</span><span style="color:#800000;">GridGroupByExpression</span><span style="color:#0000ff;">&gt;</span></span></span></p>
<p><span style="color:#000000;"> </span><span style="font-family:Verdana,sans-serif;"><span style="font-size:x-small;"><span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">GroupByExpressions</span><span style="color:#0000ff;">&gt;</span></span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:x-small;"><span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">MasterTableView</span><span style="color:#0000ff;">&gt;</span></span></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rakeshbajania.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rakeshbajania.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rakeshbajania.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rakeshbajania.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rakeshbajania.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rakeshbajania.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rakeshbajania.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rakeshbajania.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rakeshbajania.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rakeshbajania.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rakeshbajania.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rakeshbajania.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rakeshbajania.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rakeshbajania.wordpress.com/109/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshbajania.wordpress.com&amp;blog=8194453&amp;post=109&amp;subd=rakeshbajania&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rakeshbajania.wordpress.com/2011/01/20/grouping-in-radgrid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/09942868e36f7968707225d562ea2895?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rakesh.bajania</media:title>
		</media:content>
	</item>
		<item>
		<title>Change RadGrid PageSize Dropdown</title>
		<link>http://rakeshbajania.wordpress.com/2011/01/19/change-radgrid-pagesize-dropdown/</link>
		<comments>http://rakeshbajania.wordpress.com/2011/01/19/change-radgrid-pagesize-dropdown/#comments</comments>
		<pubDate>Wed, 19 Jan 2011 15:37:55 +0000</pubDate>
		<dc:creator>rakeshbajania</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Telerik]]></category>
		<category><![CDATA[Change RadGrid PageSize Dropdown]]></category>
		<category><![CDATA[Change RadGrid PageSize Dropdown Telerik]]></category>
		<category><![CDATA[Changing RadGrid PageSize Dropdown]]></category>
		<category><![CDATA[Changing RadGrid PageSize Dropdown Telerik]]></category>
		<category><![CDATA[RadGrid PageSize Dropdown]]></category>

		<guid isPermaLink="false">http://rakeshbajania.wordpress.com/?p=116</guid>
		<description><![CDATA[Introduction: Telerik&#8217;s RadGrid provides in-built functionality for paging. User have to select the number of records from the Page Size combo box (default is 10, 20 and 50) and selected number of records is going to display in RadGrid. But we can also change the Page Size in combo box as per our requirement. Following [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshbajania.wordpress.com&amp;blog=8194453&amp;post=116&amp;subd=rakeshbajania&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction:</strong></p>
<p>Telerik&#8217;s RadGrid provides in-built functionality for paging. User have to select the number of records from the Page Size combo box (default is 10, 20 and 50) and selected number of records is going to display in RadGrid. But we can also change the Page Size in combo box as per our requirement. Following is the code to do the same:</p>
<p><strong>Code:</strong></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#0000ff;">protected</span><span style="color:#000000;"> </span><span style="color:#0000ff;">void</span><span style="color:#000000;"> grdViewReport_ItemDataBound(</span><span style="color:#0000ff;">object</span><span style="color:#000000;"> sender, </span><span style="color:#2b91af;">GridItemEventArgs</span><span style="color:#000000;"> e)</span></span></span></p>
<p><span style="color:#000000;"> <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">{</span></span></span></p>
<p><span style="color:#000000;"> </span><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#0000ff;">if</span><span style="color:#000000;"> (e.Item </span><span style="color:#0000ff;">is</span><span style="color:#000000;"> </span><span style="color:#2b91af;">GridPagerItem</span><span style="color:#000000;">)</span></span></span></p>
<p><span style="color:#000000;"> <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">{</span></span></span></p>
<p><span style="color:#000000;"> </span><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#2b91af;">RadComboBox</span><span style="color:#000000;"> PageSizeCombo = (</span><span style="color:#2b91af;">RadComboBox</span><span style="color:#000000;">)e.Item.FindControl(</span><span style="color:#a31515;">&#8220;PageSizeComboBox&#8221;</span><span style="color:#000000;">);</span></span></span></p>
<p>&nbsp;</p>
<p><span style="color:#000000;"> <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">PageSizeCombo.Items.Clear();</span></span></span></p>
<p><span style="color:#000000;"> <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">PageSizeCombo.Items.Add(</span><span style="color:#0000ff;">new</span><span style="color:#000000;"> </span><span style="color:#2b91af;">RadComboBoxItem</span><span style="color:#000000;">(</span><span style="color:#a31515;">&#8220;100&#8243;</span><span style="color:#000000;">));</span></span></span></p>
<p><span style="color:#000000;"> <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">PageSizeCombo.FindItemByText(</span><span style="color:#a31515;">&#8220;100&#8243;</span><span style="color:#000000;">).Attributes.Add(</span><span style="color:#a31515;">&#8220;ownerTableViewId&#8221;</span><span style="color:#000000;">, grdViewReport.MasterTableView.ClientID);</span></span></span></p>
<p><span style="color:#000000;"> <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">PageSizeCombo.Items.Add(</span><span style="color:#0000ff;">new</span><span style="color:#000000;"> </span><span style="color:#2b91af;">RadComboBoxItem</span><span style="color:#000000;">(</span><span style="color:#a31515;">&#8220;200&#8243;</span><span style="color:#000000;">));</span></span></span></p>
<p><span style="color:#000000;"> <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">PageSizeCombo.FindItemByText(</span><span style="color:#a31515;">&#8220;200&#8243;</span><span style="color:#000000;">).Attributes.Add(</span><span style="color:#a31515;">&#8220;ownerTableViewId&#8221;</span><span style="color:#000000;">, grdViewReport.MasterTableView.ClientID);</span></span></span></p>
<p><span style="color:#000000;"> <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">PageSizeCombo.Items.Add(</span><span style="color:#0000ff;">new</span><span style="color:#000000;"> </span><span style="color:#2b91af;">RadComboBoxItem</span><span style="color:#000000;">(</span><span style="color:#a31515;">&#8220;500&#8243;</span><span style="color:#000000;">));</span></span></span></p>
<p><span style="color:#000000;"> <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">PageSizeCombo.FindItemByText(</span><span style="color:#a31515;">&#8220;500&#8243;</span><span style="color:#000000;">).Attributes.Add(</span><span style="color:#a31515;">&#8220;ownerTableViewId&#8221;</span><span style="color:#000000;">, grdViewReport.MasterTableView.ClientID);</span></span></span></p>
<p><span style="color:#000000;"> <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">PageSizeCombo.FindItemByText(e.Item.OwnerTableView.PageSize.ToString()).Selected = </span><span style="color:#0000ff;">true</span><span style="color:#000000;">;</span></span></span></p>
<p><span style="color:#000000;"> <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span></span></p>
<p><span style="color:#000000;"> <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rakeshbajania.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rakeshbajania.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rakeshbajania.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rakeshbajania.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rakeshbajania.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rakeshbajania.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rakeshbajania.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rakeshbajania.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rakeshbajania.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rakeshbajania.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rakeshbajania.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rakeshbajania.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rakeshbajania.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rakeshbajania.wordpress.com/116/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshbajania.wordpress.com&amp;blog=8194453&amp;post=116&amp;subd=rakeshbajania&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rakeshbajania.wordpress.com/2011/01/19/change-radgrid-pagesize-dropdown/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/09942868e36f7968707225d562ea2895?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rakesh.bajania</media:title>
		</media:content>
	</item>
		<item>
		<title>Extension methods in c#</title>
		<link>http://rakeshbajania.wordpress.com/2011/01/19/extension-methods-in-c/</link>
		<comments>http://rakeshbajania.wordpress.com/2011/01/19/extension-methods-in-c/#comments</comments>
		<pubDate>Wed, 19 Jan 2011 08:34:40 +0000</pubDate>
		<dc:creator>rakeshbajania</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Extension methods]]></category>
		<category><![CDATA[Extension methods in .net]]></category>
		<category><![CDATA[Extension methods in c#]]></category>
		<category><![CDATA[Extension methods in c# or .net]]></category>

		<guid isPermaLink="false">http://rakeshbajania.wordpress.com/?p=112</guid>
		<description><![CDATA[Extension methods enable you to &#8220;add&#8221; methods to existing types without creating a new derived type, recompiling, or otherwise modifying the original type. Extension methods are a special kind of static method, but they are called as if they were instance methods on the extended type. For client code written in C# and Visual Basic, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshbajania.wordpress.com&amp;blog=8194453&amp;post=112&amp;subd=rakeshbajania&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">Extension methods enable you to &#8220;add&#8221; methods to existing types without creating a new derived type, recompiling, or otherwise modifying the original type. Extension methods are a special kind of static method, but they are called as if they were instance methods on the extended type. For client code written in C# and Visual Basic, there is no apparent difference between calling an extension method and the methods that are actually defined in a type.</span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">The most common extension methods are the LINQ standard query operators that add query functionality to the existing <a href="http://msdn.microsoft.com/en-us/library/system.collections.ienumerable.aspx">System.Collections.IEnumerable</a> and <a href="http://msdn.microsoft.com/en-us/library/9eekhta0.aspx">System.Collections.Generic.IEnumerable&lt;T&gt;</a> types. To use the standard query operators, first bring them into scope with a using System.Linq directive. Then any type that implements <a href="http://msdn.microsoft.com/en-us/library/9eekhta0.aspx">IEnumerable&lt;T&gt;</a> appears to have instance methods such as <a href="http://msdn.microsoft.com/en-us/library/system.linq.enumerable.groupby.aspx">GroupBy</a>, <a href="http://msdn.microsoft.com/en-us/library/system.linq.enumerable.orderby.aspx">OrderBy</a>, <a href="http://msdn.microsoft.com/en-us/library/system.linq.enumerable.average.aspx">Average</a>, and so on. You can see these additional methods in IntelliSense statement completion when you type &#8220;dot&#8221; after an instance of an <a href="http://msdn.microsoft.com/en-us/library/9eekhta0.aspx">IEnumerable&lt;T&gt;</a> type such as <a href="http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx">List&lt;T&gt;</a> or <a href="http://msdn.microsoft.com/en-us/library/system.array.aspx">Array</a>.</span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">The following example shows how to call the standard query operator </span></span><strong><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">OrderBy</span></span></strong><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"> method on an array of integers. The expression in parentheses is a lambda expression. Many standard query operators take lambda expressions as parameters, but this is not a requirement for extension methods. For more information, see <a href="http://msdn.microsoft.com/en-us/library/bb397687.aspx">Lambda Expressions (C# Programming Guide)</a>.</span></span></p>
<pre><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">class ExtensionMethods2    </span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">{</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">static void Main()</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">{            </span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">int[] ints = { 10, 45, 15, 39, 21, 26 };</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">var result = ints.OrderBy(g =&gt; g);</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">foreach (var i in result)</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">{</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">System.Console.Write(i + " ");</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}           </span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}        </span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">//Output: 10 15 21 26 39 45</span></span>

<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">Extension methods are defined as static methods but are called by  using instance method syntax. Their first parameter specifies which type  the method operates on, and the parameter is preceded by the <a href="http://msdn.microsoft.com/en-us/library/dk1507sz.aspx">this</a> modifier. Extension methods are only in scope when you explicitly import the namespace into your source code with a using directive.</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">The following example shows an extension method defined for the <a href="http://msdn.microsoft.com/en-us/library/system.string.aspx">System.String</a> class. Note that it is defined inside a non-nested, non-generic static class:</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">namespace ExtensionMethods</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">{</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">public static class MyExtensions</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">{</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">public static int WordCount(this String str)</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">{</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">return str.Split(new char[] { ' ', '.', '?' }, </span></span>
                             <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">StringSplitOptions.RemoveEmptyEntries).Length;</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}   </span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">The WordCount extension method can be brought into scope with this using directive:</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">using ExtensionMethods;</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">And it can be called from an application by using this syntax:</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">string s = "Hello Extension Methods";</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">int i = s.WordCount();</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">In your code you invoke the extension method with instance method syntax. However, the intermediate language (IL) generated by the compiler translates your code into a call on the static method. Therefore, the principle of encapsulation is not really being violated. In fact, extension methods cannot access private variables in the type they are extending.</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">For more information, see <a href="http://msdn.microsoft.com/en-us/library/bb311042.aspx">How to: Implement and Call a Custom Extension Method (C# Programming Guide)</a>.</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">In general, you will probably be calling extension methods far more often than implementing your own. Because extension methods are called by using instance method syntax, no special knowledge is required to use them from client code. To enable extension methods for a particular type, just add a using directive for the namespace in which the methods are defined. For example, to use the standard query operators, add this using directive to your code:</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">using System.Linq;</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">(You may also have to add a reference to System.Core.dll.) You will  notice that the standard query operators now appear in IntelliSense as  additional methods available for most <a href="http://msdn.microsoft.com/en-us/library/9eekhta0.aspx">IEnumerable&lt;T&gt;</a> types.</span></span>

<a name="sectionToggle0"></a><strong><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">Binding Extension Methods at Compile Time </span></span></strong><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"> </span></span>

<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">You can use extension methods to  extend a class or interface, but not to override them. An extension  method with the same name and signature as an interface or class method  will never be called. At compile time, extension methods always have  lower priority than instance methods defined in the type itself. In  other words, if a type has a method named Process(int i),  and you have an extension method with the same signature, the compiler  will always bind to the instance method. When the compiler encounters a  method invocation, it first looks for a match in the type's instance  methods. If no match is found, it will search for any extension methods  that are defined for the type, and bind to the first extension method  that it finds. The following example demonstrates how the compiler  determines which extension method or instance method to bind to.</span></span>

<strong><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">Example: </span></span></strong>

<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">The following example  demonstrates the rules that the C# compiler follows in determining  whether to bind a method call to an instance method on the type, or to  an extension method. The static class Extensions contains extension methods defined for any type that implements IMyInterface. Classes A, B, and C all implement the interface.</span></span>

<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">The MethodB extension method is never called because its name and signature exactly match methods already implemented by the classes. </span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">When the compiler cannot find an  instance method with a matching signature, it will bind to a matching  extension method if one exists.</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">// Define an interface named IMyInterface.</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">namespace DefineIMyInterface</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">{</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">using System;</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">public interface IMyInterface</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">{</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">// Any class that implements IMyInterface must define a method</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">// that matches the following signature.</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">void MethodB();</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">// Define extension methods for IMyInterface.</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">namespace Extensions</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">{</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">using System;</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">using DefineIMyInterface;</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">// The following extension methods can be accessed by instances of any </span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">// class that implements IMyInterface.</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">public static class Extension</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">{</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">public static void MethodA(this IMyInterface myInterface, int i)</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">{</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">Console.WriteLine</span></span>
                <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">("Extension.MethodA(this IMyInterface myInterface, int i)");</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">public static void MethodA(this IMyInterface myInterface, string s)</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">{</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">Console.WriteLine</span></span>
                <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">("Extension.MethodA(this IMyInterface myInterface, string s)");</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">// This method is never called in ExtensionMethodsDemo1, because each </span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">// of the three classes A, B, and C implements a method named MethodB</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">// that has a matching signature.</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">public static void MethodB(this IMyInterface myInterface)</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">{</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">Console.WriteLine</span></span>
                <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">("Extension.MethodB(this IMyInterface myInterface)");</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">// Define three classes that implement IMyInterface, and then use them to test</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">// the extension methods.</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">namespace ExtensionMethodsDemo1</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">{</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">using System;</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">using Extensions;</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">using DefineIMyInterface;</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">class A : IMyInterface</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">{</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">public void MethodB() { Console.WriteLine("A.MethodB()"); }</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">class B : IMyInterface</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">{</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">public void MethodB() { Console.WriteLine("B.MethodB()"); }</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">public void MethodA(int i) { Console.WriteLine("B.MethodA(int i)"); }</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">class C : IMyInterface</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">{</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">public void MethodB() { Console.WriteLine("C.MethodB()"); }</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">public void MethodA(object obj)</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">{</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">Console.WriteLine("C.MethodA(object obj)");</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">class ExtMethodDemo</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">{</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">static void Main(string[] args)</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">{</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">// Declare an instance of class A, class B, and class C.</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">A a = new A();</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">B b = new B();</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">C c = new C();</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">// For a, b, and c, call the following methods:</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">//      -- MethodA with an int argument</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">//      -- MethodA with a string argument</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">//      -- MethodB with no argument.</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">// A contains no MethodA, so each call to MethodA resolves to </span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">// the extension method that has a matching signature.</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">a.MethodA(1);           // Extension.MethodA(object, int)</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">a.MethodA("hello");     // Extension.MethodA(object, string)</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">// A has a method that matches the signature of the following call</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">// to MethodB.</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">a.MethodB();            // A.MethodB()</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">// B has methods that match the signatures of the following</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">// nethod calls.</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">b.MethodA(1);           // B.MethodA(int)</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">b.MethodB();            // B.MethodB()</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">// B has no matching method for the following call, but </span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">// class Extension does.</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">b.MethodA("hello");     // Extension.MethodA(object, string)</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">// C contains an instance method that matches each of the following</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">// method calls.</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">c.MethodA(1);           // C.MethodA(object)</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">c.MethodA("hello");     // C.MethodA(object)</span></span>
            <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">c.MethodB();            // C.MethodB()</span></span>
        <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">/* Output:</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">Extension.MethodA(this IMyInterface myInterface, int i)</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">Extension.MethodA(this IMyInterface myInterface, string s)</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">A.MethodB()</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">B.MethodA(int i)</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">B.MethodB()</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">Extension.MethodA(this IMyInterface myInterface, string s)</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">C.MethodA(object obj)</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">C.MethodA(object obj)</span></span>
    <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">C.MethodB()</span></span>
 <span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">*/</span></span>

<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><strong>General Guidelines</strong></span></span>

<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">In general, we recommend that  you implement extension methods sparingly and only when you have to.  Whenever possible, client code that must extend an existing type should  do so by creating a new type derived from the existing type. For more  information, see <a href="http://msdn.microsoft.com/en-us/library/ms173149.aspx">Inheritance (C# Programming Guide)</a>. </span></span>

<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">When using an extension method  to extend a type whose source code you cannot change, you run the risk  that a change in the implementation of the type will cause your  extension method to break. </span></span>
<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">If you do implement extension methods for a given type, remember the following two points:  </span></span>

<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">1) An extension method will never be called if it has the same signature as a method defined in the type.  </span></span>

<span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">2)Extension methods are brought into scope at the namespace level.  For example, if you have multiple static classes that contain extension  methods in a single namespace named Extensions, they will all be brought into scope by the using Extensions; directive.</span></span></pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rakeshbajania.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rakeshbajania.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rakeshbajania.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rakeshbajania.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rakeshbajania.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rakeshbajania.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rakeshbajania.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rakeshbajania.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rakeshbajania.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rakeshbajania.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rakeshbajania.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rakeshbajania.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rakeshbajania.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rakeshbajania.wordpress.com/112/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshbajania.wordpress.com&amp;blog=8194453&amp;post=112&amp;subd=rakeshbajania&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rakeshbajania.wordpress.com/2011/01/19/extension-methods-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/09942868e36f7968707225d562ea2895?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rakesh.bajania</media:title>
		</media:content>
	</item>
		<item>
		<title>GROUP BY Query in LINQ TO ENTITY</title>
		<link>http://rakeshbajania.wordpress.com/2011/01/18/group-by-query-in-linq-to-entity/</link>
		<comments>http://rakeshbajania.wordpress.com/2011/01/18/group-by-query-in-linq-to-entity/#comments</comments>
		<pubDate>Tue, 18 Jan 2011 13:02:12 +0000</pubDate>
		<dc:creator>rakeshbajania</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[GROUP BY Query in LINQ TO ENTITY]]></category>

		<guid isPermaLink="false">http://rakeshbajania.wordpress.com/?p=107</guid>
		<description><![CDATA[Introduction: When we create our application using LINQ, in that case we have to write all SQL queries using LINQ query operators. And it is a general requirement to write GROUP BY query when we try to build reports in our application in most cases. CODE: Following is the code or Query example to write [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshbajania.wordpress.com&amp;blog=8194453&amp;post=107&amp;subd=rakeshbajania&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction:</strong></p>
<p>When we create our application using LINQ, in that case we have to write all SQL queries using LINQ query operators. And it is a general requirement to write <strong>GROUP BY</strong> query when we try to build reports in our application in most cases.</p>
<p><strong>CODE:</strong></p>
<p>Following is the code or Query example to write GROUP BY Query in LINQ to Entities or Entity Framework:</p>
<p>var objData = from f in DASEntity.FILES<br />
from fr in DASEntity.FILE_REQUEST_DETAILS<br />
from s in DASEntity.STATUS<br />
where f.ID == fr.FILE_ID<br />
&amp;&amp; fr.STATUS_ID == s.ID<br />
&amp;&amp; f.CLIENT_TOKEN == ClientToken<br />
&amp;&amp; fr.CLIENT_TOKEN == ClientToken<br />
group s by new { s.ID, s.NAME } into t<br />
select new<br />
{<br />
StatusID = t.Key.ID,<br />
Name = t.Key.NAME,<br />
FileCount = t.Count()<br />
};</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rakeshbajania.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rakeshbajania.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rakeshbajania.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rakeshbajania.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rakeshbajania.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rakeshbajania.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rakeshbajania.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rakeshbajania.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rakeshbajania.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rakeshbajania.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rakeshbajania.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rakeshbajania.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rakeshbajania.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rakeshbajania.wordpress.com/107/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshbajania.wordpress.com&amp;blog=8194453&amp;post=107&amp;subd=rakeshbajania&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rakeshbajania.wordpress.com/2011/01/18/group-by-query-in-linq-to-entity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/09942868e36f7968707225d562ea2895?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rakesh.bajania</media:title>
		</media:content>
	</item>
		<item>
		<title>Firefox and the FileUpload control in ASP.NET</title>
		<link>http://rakeshbajania.wordpress.com/2011/01/18/firefox-and-the-fileupload-control-in-asp-net/</link>
		<comments>http://rakeshbajania.wordpress.com/2011/01/18/firefox-and-the-fileupload-control-in-asp-net/#comments</comments>
		<pubDate>Tue, 18 Jan 2011 10:46:22 +0000</pubDate>
		<dc:creator>rakeshbajania</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[FileUpload control in ASP.NET]]></category>
		<category><![CDATA[FileUpload control in ASP.NET + FireFox]]></category>
		<category><![CDATA[Firefox and the FileUpload control in ASP.NET]]></category>

		<guid isPermaLink="false">http://rakeshbajania.wordpress.com/?p=105</guid>
		<description><![CDATA[I’ve been pretty annoyed about the fact that FireFox ignores the width property of the ASP.NET FileUpload control. It doesn’t matter if you set it by CSS or even in JavaScript, Firefox always ignores it and that results in a crippled layout since you have no control over the width of the upload input field. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshbajania.wordpress.com&amp;blog=8194453&amp;post=105&amp;subd=rakeshbajania&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I’ve been pretty annoyed about the fact that FireFox ignores the width property of the ASP.NET <a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.fileupload.aspx">FileUpload</a> control. It doesn’t matter if you set it by CSS or even in JavaScript,  Firefox always ignores it and that results in a crippled layout since  you have no control over the width of the upload input field. This  actually has nothing to do with the FileUpload control, but with the  rendered output of that control, which is just a standard  field.</p>
<p>Here  the width is set to 400px. The FileUpload control renders the Width  attribute to the correct CSS style value of 400px at runtime.</p>
<div>FileUpload runat=&#8221;server&#8221; ID=&#8221;txtUpload&#8221; Width=&#8221;400&#8243; /&gt;</div>
<p>But as mentioned, Firefox totally ignores that. Then I remembered a forum thread I read some years ago about a <em>size</em> attribute. The only thing I could find was this <a href="http://htmlhelp.com/reference/html40/forms/input.html">list of available HTML attributes</a>, but I gave it a try.</p>
<p>This is what I ended up with. The <em>size</em> attribute actually works in Firefox and IE ignores it, but adheres to the <em>Width</em> attribute instead.</p>
<div>FileUpload runat=&#8221;server&#8221; ID=&#8221;txtUpload&#8221; Width=&#8221;400&#8243; size=&#8221;50&#8243; /&gt;</div>
<p>The <em>size</em> attribute determines the number of characters should be visible and  then adjusts the width accordingly. It is not the same as setting a  maximum length of the file name, so it doesn’t break anything.</p>
<p>You  should think that since a size of 50 generates the same width as 400px  that you could always just divide the width in pixels with 8 to find the  equivalent size. That is not the case. You have to manually adjust  every time until you find the right size value that matches the pixel  width</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rakeshbajania.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rakeshbajania.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rakeshbajania.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rakeshbajania.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rakeshbajania.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rakeshbajania.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rakeshbajania.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rakeshbajania.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rakeshbajania.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rakeshbajania.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rakeshbajania.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rakeshbajania.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rakeshbajania.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rakeshbajania.wordpress.com/105/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshbajania.wordpress.com&amp;blog=8194453&amp;post=105&amp;subd=rakeshbajania&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rakeshbajania.wordpress.com/2011/01/18/firefox-and-the-fileupload-control-in-asp-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/09942868e36f7968707225d562ea2895?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rakesh.bajania</media:title>
		</media:content>
	</item>
		<item>
		<title>Tricks to increase SQL Server query performance</title>
		<link>http://rakeshbajania.wordpress.com/2011/01/18/tricks-to-increase-sql-server-query-performance/</link>
		<comments>http://rakeshbajania.wordpress.com/2011/01/18/tricks-to-increase-sql-server-query-performance/#comments</comments>
		<pubDate>Tue, 18 Jan 2011 10:44:44 +0000</pubDate>
		<dc:creator>rakeshbajania</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[increase SQL Server query performance]]></category>
		<category><![CDATA[SQL Server query performance]]></category>
		<category><![CDATA[Tricks to increase SQL Server query performance]]></category>

		<guid isPermaLink="false">http://rakeshbajania.wordpress.com/?p=103</guid>
		<description><![CDATA[Thanks to the natural language roots of the SQL language, writing queries has become extremely easy for just about anyone to pick up. But its simplicity also makes it easy to write poorly performing queries. Here are some simple changes you can make to improve not only query performance, but, in some cases, overall SQL [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshbajania.wordpress.com&amp;blog=8194453&amp;post=103&amp;subd=rakeshbajania&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Thanks to the natural language roots of the SQL language, writing  queries has become extremely easy for just about anyone to pick up. But  its simplicity also makes it easy to write poorly performing queries.  Here are some simple changes you can make to improve not only query  performance, but, in some cases, overall SQL Server system performance  as well.</p>
<p>CREATE TABLE vs. SELECT INTO</p>
<p>Oftentimes,  within stored procedures or other SQL scripts, temp tables must be  created and loaded with data. When writing these queries, many SQL  Server DBAs and developers like to use the SELECT INTO method, like  this:</p>
<p>SELECT *<br />
INTO #TempTable<br />
FROM sysobjects</p>
<p>While  this technique works fine for small tables, when dealing with large  record sets or long-running queries, it creates locks on the system  objects within the tempdb database. As a result, other queries and  procedures that need to create objects within the tempdb database will  have to wait for the long-running query to complete. This is because  when an object is created, an exclusive lock is taken against the  sysobjects, syscolumns, sysindexes, etc system tables (SQL Server 2000)  or the sysallocunits, syscolpars, syshobtcolumns, sysschobjs, sysserefs,  etc system tables (SQL Server 2005). You can see this easily by opening  two query windows and running the following:</p>
<p>(First window)<br />
begin tran<br />
create table #test1 (c1 int)<br />
(Second window SQL 2005)<br />
select object_name(rsc_objid), *<br />
from sys.syslockinfo<br />
where req_spid = 52 /*Where 52 = the SPID of the first window*/<br />
order by 1</p>
<p>(Second window SQL Server 2000)<br />
sp_lock 52 /*Where 52 = the SPID of the first window*/</p>
<p>When  you have a very long-running query in a temporary table using the  SELECT INTO format, those same system table locks are held until the  query completes and data loads into the temp table. You can avoid system  table locking by manually creating the table with the CREATE TABLE  command—before loading the data into the table.<br />
For example, this code&#8230;</p>
<p>CREATE TABLE #TempTable<br />
(spid int)<br />
INSERT INTO #TempTable<br />
SELECT spid<br />
FROM sys.objects</p>
<p>&#8230;will require much less locking than this code:</p>
<p>SELECT spid<br />
INTO #TempTable<br />
FROM sys.objects</p>
<p>While  the total number of locks taken is the same, the length of time the  locks are held for the first query will be much shorter. This allows  other processes to create temp tables.<br />
Typically, when developing SQL  code the development server has only a single user or few users. When  working on SQL code, it&#8217;s important to know when the code will impact  sessions other than the current session. And unexpected interaction can  cause major performance issues.</p>
<p>Accessing data across linked servers</p>
<p>Linked servers are an excellent way to get data in real-time from one  server to another. However, incorrectly written linked server queries  can quickly decrease system performance on one or both servers. While  it&#8217;s easy to write these queries across linked servers, the query  optimizer doesn&#8217;t always work as you would expect. I often see queries  that join a local table to two remote tables and the queries take hours  to run. That&#8217;s because the local optimizer doesn&#8217;t know which records to  request from the remote table.<br />
It therefore requests that the remote  server transmit the entire table, and all that data is then loaded into  a temporary table and the join is done locally. Unfortunately, because  the local table is a temporary table—and not a physical table on the  source system—the indexes on the remote table do not get created on the  temporary table. Because of the lack of indexes, expected query  execution time skyrockets.</p>
<p>There are a couple of techniques you  can use to improve query response time. The first is to create a stored  procedure on the remote database and have it return a record set, being a  subset of the remote tables, which is then loaded into a local  temporary table. It can then be indexed as needed. The trick with this  method is to provide an input variable to the remote procedure where  input values can be passed to. Thus, you will reduce the number of  returned records by as much as possible. Fewer records will reduce the  run time of that stored procedure as well as<br />
the network latency on transferring those records from the remote system to the local system.<br />
The  second technique you can use is a variation of the first method. You  create local temporary tables for each of the remote tables and transfer  over the columns and records needed from each of the remote tables.  Next, index the tables as needed and join the temp tables locally.<br />
While  the second technique is easier and faster to set up and implement, the  first method gives you a greater performance savings, as typically less  data needs to be transferred between servers.</p>
<p>Subqueries as join partners</p>
<p>When  working with joins, you may want to manually control the order that  data is selected. An easy (and usually safe) way to do this is to use  subqueries as the join object instead of joining directly to a table. In  some instances, you can decrease your query execution time by forcing  the SQL Server to prefilter data in the table. This method is not  foolproof and if used incorrectly it can increase the execution time of  your query. The method should be fully tested before moving it to your  production environment.</p>
<p>As we have seen, there are some quick and  easy methods for improving query performance for  some long-running  processes. While these techniques will not apply to every issue you run  across, they will help in some instances.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rakeshbajania.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rakeshbajania.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rakeshbajania.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rakeshbajania.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rakeshbajania.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rakeshbajania.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rakeshbajania.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rakeshbajania.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rakeshbajania.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rakeshbajania.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rakeshbajania.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rakeshbajania.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rakeshbajania.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rakeshbajania.wordpress.com/103/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshbajania.wordpress.com&amp;blog=8194453&amp;post=103&amp;subd=rakeshbajania&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rakeshbajania.wordpress.com/2011/01/18/tricks-to-increase-sql-server-query-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/09942868e36f7968707225d562ea2895?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rakesh.bajania</media:title>
		</media:content>
	</item>
		<item>
		<title>Simple way to Show/Hide Filter in RadGrid</title>
		<link>http://rakeshbajania.wordpress.com/2011/01/13/filer-hide-or-show/</link>
		<comments>http://rakeshbajania.wordpress.com/2011/01/13/filer-hide-or-show/#comments</comments>
		<pubDate>Thu, 13 Jan 2011 10:45:40 +0000</pubDate>
		<dc:creator>rakeshbajania</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Telerik]]></category>
		<category><![CDATA[hide or show RadGrid's Filter in Telerik]]></category>
		<category><![CDATA[hide or show RadGrid's Filter in Telerik asp.net]]></category>
		<category><![CDATA[hide RadGrid's Filter in Telerik]]></category>
		<category><![CDATA[RadGrid's Filter in Telerik]]></category>

		<guid isPermaLink="false">http://rakeshbajania.wordpress.com/?p=96</guid>
		<description><![CDATA[Description: Telerik&#8217;s RadGrid provides in-built search functionality. You can find the search functionality at top of the grid just below the header columns. But user should be able to hide the same to save unnecessary space all the time from the grid. RadGrid Example when Filter is not visible to the user: RadGrid Example when [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshbajania.wordpress.com&amp;blog=8194453&amp;post=96&amp;subd=rakeshbajania&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;">Description:</span></span></strong></p>
<p><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;">Telerik&#8217;s RadGrid provides in-built search functionality. You can find the search functionality at top of the grid just below the header columns. But user should be able to hide the same to save unnecessary space all the time from the grid.</span></span></p>
<p><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><strong>RadGrid Example when Filter is not visible to the user:</strong></span></span></p>
<p><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"> </span></span></p>
<div id="attachment_125" class="wp-caption aligncenter" style="width: 507px"><a href="http://rakeshbajania.files.wordpress.com/2011/01/without.png"><img class="size-full wp-image-125" title="Radgrid without Filter" src="http://rakeshbajania.files.wordpress.com/2011/01/without.png?w=630" alt="Radgrid without Filter"   /></a><p class="wp-caption-text">Radgrid without Filter</p></div>
<p><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"> </span></span></p>
<p><strong>RadGrid Example </strong><strong>when Filter is visible to the user:</strong></p>
<div id="attachment_127" class="wp-caption aligncenter" style="width: 507px"><a href="http://rakeshbajania.files.wordpress.com/2011/01/with1.png"><img class="size-full wp-image-127" title="RadGrid With Filter" src="http://rakeshbajania.files.wordpress.com/2011/01/with1.png?w=630" alt="RadGrid With Filter"   /></a><p class="wp-caption-text">RadGrid With Filter</p></div>
<p><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><br />
</span></span></p>
<p><strong><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;">Code:</span></span></strong></p>
<p><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;">First</span></span><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"> </span></span><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;">of all in RadGrid&#8217;s MasterTableView tag, add following checkbox<strong>:</strong></span></span><strong><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><br />
</span></span></strong></p>
<p><strong><span style="color:#0000ff;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">&lt;</span></span></span></strong><strong><span style="color:#800000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">MasterTableView</span></span></span></strong><strong><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"> </span></span></span></strong><strong><span style="color:#ff0000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">Width</span></span></span></strong><strong><span style="color:#0000ff;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">=&#8221;100%&#8221;</span></span></span></strong><strong><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"> </span></span></span></strong><strong><span style="color:#ff0000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">CommandItemDisplay</span></span></span></strong><strong><span style="color:#0000ff;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">=&#8221;Top&#8221;</span></span></span></strong><strong><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"> </span></span></span></strong><strong><span style="color:#ff0000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">GroupLoadMode</span></span></span></strong><strong><span style="color:#0000ff;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">=&#8221;Server&#8221;&gt;</span></span></span></strong></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">CommandItemTemplate</span><span style="color:#0000ff;">&gt;</span></span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">asp</span><span style="color:#0000ff;">:</span><span style="color:#800000;">CheckBox</span><span style="color:#000000;"> </span><span style="color:#ff0000;">ID</span><span style="color:#0000ff;">=&#8221;CheckBox2&#8243;</span><span style="color:#000000;"> </span><span style="color:#ff0000;">AutoPostBack</span><span style="color:#0000ff;">=&#8221;true&#8221;</span><span style="color:#000000;"> </span><span style="color:#ff0000;">CssClass</span><span style="color:#0000ff;">=&#8221;CheckBox&#8221;</span><span style="color:#000000;"> </span><span style="color:#ff0000;">runat</span><span style="color:#0000ff;">=&#8221;server&#8221;</span></span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#ff0000;">ForeColor</span><span style="color:#0000ff;">=&#8221;White&#8221;</span><span style="color:#000000;"> </span><span style="color:#ff0000;">Text</span><span style="color:#0000ff;">=&#8221;Show Filter&#8221;</span><span style="color:#000000;"> </span><span style="color:#0000ff;">/&gt;</span></span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">CommandItemTemplate</span><span style="color:#0000ff;">&gt;</span></span></span></p>
<p><strong><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">After that add the ItemCreated event in the RadGrid as following code does</span></span><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">:</span></span></strong><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"> </span></span></p>
<p><strong><span style="color:#0000ff;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">protected</span></span></span></strong><strong><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"> </span></span></span></strong><strong><span style="color:#0000ff;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">void</span></span></span></strong><strong><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"> grdManageTransType_ItemCreated(</span></span></span></strong><strong><span style="color:#0000ff;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">object</span></span></span></strong><strong><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"> sender, </span></span></span></strong><strong><span style="color:#2b91af;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">GridItemEventArgs</span></span></span></strong><strong><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"> e)</span></span></span></strong></p>
<p><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">{</span></span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#0000ff;">if</span><span style="color:#000000;"> (e.Item.ItemType == </span><span style="color:#2b91af;">GridItemType</span><span style="color:#000000;">.CommandItem)</span></span></span></p>
<p><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">{</span></span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#2b91af;">GridCommandItem</span><span style="color:#000000;"> commandItem = e.Item </span><span style="color:#0000ff;">as</span><span style="color:#000000;"> </span><span style="color:#2b91af;">GridCommandItem</span><span style="color:#000000;">;</span></span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#2b91af;">CheckBox</span><span style="color:#000000;"> chkFilter2 = (</span><span style="color:#2b91af;">CheckBox</span><span style="color:#000000;">)commandItem.FindControl(</span><span style="color:#a31515;">&#8220;CheckBox2&#8243;</span><span style="color:#000000;">);</span></span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#000000;">chkFilter2.AutoPostBack = </span><span style="color:#0000ff;">true</span><span style="color:#000000;">;</span></span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#000000;">chkFilter2.ForeColor = System.Drawing.</span><span style="color:#2b91af;">Color</span><span style="color:#000000;">.White;</span></span></span></p>
<p><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">chkFilter2.Checked = grdManageTransType.AllowFilteringByColumn;</span></span></span></p>
<p><span style="color:#008000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">//Adding the event handler </span></span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#000000;">chkFilter2.CheckedChanged += </span><span style="color:#0000ff;">new</span><span style="color:#000000;"> </span><span style="color:#2b91af;">EventHandler</span><span style="color:#000000;">(chkFilter2_CheckedChanged);</span></span></span></p>
<p><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#0000ff;">if</span><span style="color:#000000;"> (e.Item.ItemType == </span><span style="color:#2b91af;">GridItemType</span><span style="color:#000000;">.SelectedItem)</span></span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><span style="color:#000000;">e.Item.BackColor = </span><span style="color:#2b91af;">Color</span><span style="color:#000000;">.FromName(</span><span style="color:#a31515;">&#8220;#FFEDC1&#8243;</span><span style="color:#000000;">);</span></span></span></p>
<p><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span></span></p>
<p><span style="font-family:Verdana,sans-serif;"><span style="color:#000000;"><span style="font-size:small;">In above portion of code we are creating CheckedChanged event of the checkbox. So now create the CheckedChanged event of the checkbox as per following code: </span></span><span style="font-size:small;"> </span></span></p>
<p><strong><span style="color:#0000ff;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">protected</span></span></span></strong><strong><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"> </span></span></span></strong><strong><span style="color:#0000ff;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">void</span></span></span></strong><strong><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"> chkFilter2_CheckedChanged(</span></span></span></strong><strong><span style="color:#0000ff;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">object</span></span></span></strong><strong><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"> sender, </span></span></span></strong><strong><span style="color:#2b91af;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">EventArgs</span></span></span></strong><strong><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"> e)</span></span></span></strong></p>
<p><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">{</span></span></span></p>
<p><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">grdManageTransType.AllowFilteringByColumn = !grdManageTransType.AllowFilteringByColumn;</span></span></span></p>
<p><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">grdManageTransType.Rebind();</span></span></span></p>
<p><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">}</span></span></span></p>
<p><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">As per the above code portions, we can the checkbox at the top of the RadGrid. On click of that checkbox RadGrid&#8217;s filter should be visible on or off.</span></span></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rakeshbajania.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rakeshbajania.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rakeshbajania.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rakeshbajania.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rakeshbajania.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rakeshbajania.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rakeshbajania.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rakeshbajania.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rakeshbajania.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rakeshbajania.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rakeshbajania.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rakeshbajania.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rakeshbajania.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rakeshbajania.wordpress.com/96/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshbajania.wordpress.com&amp;blog=8194453&amp;post=96&amp;subd=rakeshbajania&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rakeshbajania.wordpress.com/2011/01/13/filer-hide-or-show/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/09942868e36f7968707225d562ea2895?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rakesh.bajania</media:title>
		</media:content>

		<media:content url="http://rakeshbajania.files.wordpress.com/2011/01/without.png" medium="image">
			<media:title type="html">Radgrid without Filter</media:title>
		</media:content>

		<media:content url="http://rakeshbajania.files.wordpress.com/2011/01/with1.png" medium="image">
			<media:title type="html">RadGrid With Filter</media:title>
		</media:content>
	</item>
		<item>
		<title>Count items in Telerik&#8217;s RadComboBox</title>
		<link>http://rakeshbajania.wordpress.com/2011/01/13/count-items-in-teleriks-radcombobox/</link>
		<comments>http://rakeshbajania.wordpress.com/2011/01/13/count-items-in-teleriks-radcombobox/#comments</comments>
		<pubDate>Thu, 13 Jan 2011 10:29:38 +0000</pubDate>
		<dc:creator>rakeshbajania</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Telerik]]></category>
		<category><![CDATA[Count items in RadComboBox]]></category>
		<category><![CDATA[Count items in Telerik's dropdown]]></category>
		<category><![CDATA[Count items in Telerik's RadComboBox]]></category>

		<guid isPermaLink="false">http://rakeshbajania.wordpress.com/?p=93</guid>
		<description><![CDATA[Description: It is general requirement to show and count number of items in Telerik&#8217;s RadComboBox. And we can do that by using a simple javascript function. Code: In javasript: function UpdateItemCountField(sender, args) { //set the footer text sender.get_dropDownElement().lastChild.innerHTML = &#8220;A total of &#8220; + sender.get_items().get_count() + &#8221; items&#8221;; } In aspx page: add footer template [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshbajania.wordpress.com&amp;blog=8194453&amp;post=93&amp;subd=rakeshbajania&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;">Description:</span></span></strong></p>
<p><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;">It is general requirement to show and count number of items in Telerik&#8217;s RadComboBox. And we can do that by using a simple javascript function.</span></span></p>
<p><strong><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;">Code:</span></span></strong></p>
<p><strong><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;">In javasript:</span></span></strong></p>
<p><span style="font-size:small;"><span style="color:#0000ff;"><span style="font-family:Consolas;">function</span></span><span style="color:#000000;"><span style="font-family:Consolas;"> UpdateItemCountField(sender, args) {</span></span></span></p>
<p><span style="color:#000000;"> </span><span style="font-size:small;"><span style="color:#006400;"><span style="font-family:Consolas;">//set the footer text</span></span></span></p>
<p><span style="color:#000000;"> <span style="font-size:small;"><span style="font-family:Consolas;">sender.get_dropDownElement().lastChild.innerHTML = </span></span><span style="color:#800000;"><span style="font-family:Consolas;">&#8220;A total of &#8220;</span></span><span style="color:#000000;"><span style="font-family:Consolas;"> + sender.get_items().get_count() + </span></span><span style="color:#800000;"><span style="font-family:Consolas;">&#8221; items&#8221;</span></span><span style="color:#000000;"><span style="font-family:Consolas;">;</span></span></span></p>
<p><span style="color:#000000;"> <span style="font-family:Consolas;"><span style="font-size:small;">}</span></span></span></p>
<p><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;"><strong>In aspx page:</strong></span></span></span></p>
<p><span style="color:#000000;"><span style="font-family:Verdana,sans-serif;"><span style="font-size:small;">add footer template as shown below code.</span></span></span></p>
<p><span style="color:#000000;"><span style="font-family:Consolas,monospace;"><span style="font-size:small;"><strong><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">FooterTemplate</span><span style="color:#0000ff;">&gt;</span></strong></span></span></span></p>
<p><span style="color:#000000;"><span style="font-family:Consolas,monospace;"><span style="font-size:small;"><strong> A total of</strong></span></span></span></p>
<p><span style="color:#000000;"> </span><span style="font-family:Consolas,monospace;"><span style="font-size:small;"><strong><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">asp</span><span style="color:#0000ff;">:</span><span style="color:#800000;">Literal</span><span style="color:#000000;"> </span><span style="color:#ff0000;">runat</span><span style="color:#0000ff;">=&#8221;server&#8221;</span><span style="color:#000000;"> </span><span style="color:#ff0000;">ID</span><span style="color:#0000ff;">=&#8221;RadComboItemsCount&#8221;</span><span style="color:#000000;"> </span><span style="color:#0000ff;">/&gt;</span></strong></span></span></p>
<p><span style="color:#000000;"> <span style="font-family:Consolas,monospace;"><span style="font-size:small;"><strong> items</strong></span></span></span></p>
<p><span style="font-family:Consolas,monospace;"><span style="font-size:small;"><strong><span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">FooterTemplate</span><span style="color:#0000ff;">&gt;</span></strong></span></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rakeshbajania.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rakeshbajania.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rakeshbajania.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rakeshbajania.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rakeshbajania.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rakeshbajania.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rakeshbajania.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rakeshbajania.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rakeshbajania.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rakeshbajania.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rakeshbajania.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rakeshbajania.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rakeshbajania.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rakeshbajania.wordpress.com/93/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rakeshbajania.wordpress.com&amp;blog=8194453&amp;post=93&amp;subd=rakeshbajania&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rakeshbajania.wordpress.com/2011/01/13/count-items-in-teleriks-radcombobox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/09942868e36f7968707225d562ea2895?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rakesh.bajania</media:title>
		</media:content>
	</item>
	</channel>
</rss>
