<?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>GridView</title>
	<atom:link href="http://gridview.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://gridview.wordpress.com</link>
	<description>ASP.Net Gridview</description>
	<lastBuildDate>Thu, 10 Nov 2011 16:57:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='gridview.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>GridView</title>
		<link>http://gridview.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://gridview.wordpress.com/osd.xml" title="GridView" />
	<atom:link rel='hub' href='http://gridview.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Binding Images in WPF Listbox from DB</title>
		<link>http://gridview.wordpress.com/2011/02/21/binding-images-in-wpf-listbox-from-db/</link>
		<comments>http://gridview.wordpress.com/2011/02/21/binding-images-in-wpf-listbox-from-db/#comments</comments>
		<pubDate>Mon, 21 Feb 2011 01:36:35 +0000</pubDate>
		<dc:creator>VB</dc:creator>
				<category><![CDATA[Databinding]]></category>

		<guid isPermaLink="false">http://gridview.wordpress.com/?p=84</guid>
		<description><![CDATA[WPF Listbox Binding Images from DB WPF ListBox control is quite different from windows win forms and it has lots of abilities to extend and design. With just ListBox we can design most of the equivalent controls available in ASP.Net data controls section. However the implementation of WPF ListBox is also quite different from win [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gridview.wordpress.com&amp;blog=9845954&amp;post=84&amp;subd=gridview&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>WPF Listbox Binding Images from DB</h2>
<p>WPF ListBox control is quite different from windows win forms and it has lots of abilities to extend and design. With just ListBox we can design most of the equivalent controls available in ASP.Net data controls section. However the implementation of WPF ListBox is also quite different from win forms and ASP.Net controls.  Due to increase in the sale of <a title="Cheap Netbooks Under 200 USD" href="http://www.cheapnetbooksunder200.net/">Cheap Netbooks Under 200</a>, more and more people are going to use browser based light weight applications that are hosted using a silver light or WPF. So it is better to use WPF, if required it is much easier to convert it to silverlight.For e.g. binding an image is bit tricky than we do in ASP.Net and the linq and Ms SQL Sample DB northwind may demand additional knowledge on the respective technologies</p>
<h3>Fetching Database values using Linq to SQL</h3>
<p>As it has been already discussed in detail in the article <a href="http://www.vbnettutorial.net/?Id=128&amp;Desc=WPF-Datagrid-and-Linq-to-SQL">WPF Datagrid and Linq to SQL</a>, I am not going to detail again here. We can use the Linq to SQL to fetch the data and pass it to the WPF to bind the ListBox. The equivalent datatypes will be chose for the respective database fields. So the important mapping we need to note is the Image Datatype in SQL server. This will be mapped as System.Data.Linq.Binary. So when binding this to the Image we need to convert System.Data.Linq.Binary to the expected BitmapSource format.</p>
<h3>Converter for Image Source</h3>
<p>Since we need to convert the System.Data.Linq.Binary to BitmapSource, we need to specify the converter while assigning the source for the Image in the markup. This can be specified as a StaticResource. Without creating a static resource the markup does not know how to create an instance of the converter class.</p>
<h3>Static Resources for the Converter Class</h3>
<p>So we need to create a static resource and map the respective class file in the resources section. In the resources section under Window.Resources, we can create the static resource with a reference to the class object. This class object can be specified in the window tag as an attribute xmlns. We can specify our own namespace. In this case I named it as local and targeted to the class ImageConverter.</p>
<h3>Image Converter class using the IValueConverter Interface</h3>
<p>This converter has to be implementing the IValueConverter. This IValueConverter has the contract to define two methods Convert and ConvertBack.  There are some interesting facts to note here in this converter for images. I realized after few hours of struggling that I need to offset 78 bytes for images from Northwind because of the Ole Datatype. The convertback function can be returning null or can throw a not implemented exception</p>
<p><strong>More information and source code an be found at</strong></p>
<p><a href="http://www.vbnettutorial.net/?Id=137&amp;Desc=Wpf-Listbox-Image-Binding-From-Db">Wpf Listbox Image Databinding FromDatabase</a></p>
<p><a href="http://digg.com/ponssaravanan"></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gridview.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gridview.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gridview.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gridview.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gridview.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gridview.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gridview.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gridview.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gridview.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gridview.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gridview.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gridview.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gridview.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gridview.wordpress.com/84/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gridview.wordpress.com&amp;blog=9845954&amp;post=84&amp;subd=gridview&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gridview.wordpress.com/2011/02/21/binding-images-in-wpf-listbox-from-db/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ac54478ac87629d40a409377ee94ba78?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">VB</media:title>
		</media:content>
	</item>
		<item>
		<title>Ajaxified Row Filter for ASP.Net Gridview</title>
		<link>http://gridview.wordpress.com/2011/02/05/ajaxified-row-filter-for-asp-net-gridview/</link>
		<comments>http://gridview.wordpress.com/2011/02/05/ajaxified-row-filter-for-asp-net-gridview/#comments</comments>
		<pubDate>Sat, 05 Feb 2011 03:16:07 +0000</pubDate>
		<dc:creator>VB</dc:creator>
				<category><![CDATA[AJAX]]></category>

		<guid isPermaLink="false">http://gridview.wordpress.com/?p=80</guid>
		<description><![CDATA[Filter rows in Asp.Net Ajax GridView When working in a large amount of data, filtering to get a subset is always essential. So I have written this code. Here I refer filter as filtering records at the application level not at the database level. Usually I put the data in the Viewstate or in session [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gridview.wordpress.com&amp;blog=9845954&amp;post=80&amp;subd=gridview&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Filter rows in Asp.Net Ajax GridView </strong></p>
<p>When working in a large amount of data, filtering to get a subset is always essential. So I have written this code. Here I refer filter as filtering records at the application level not at the database level. Usually I put the data in the Viewstate or in session if the data is not too huge. Then apply the filter to get the data based on the filter.</p>
<p><strong>Note: </strong><br />
1) As it is already explained in earlier articles in section <strong><a href="http://www.vbknowledgebase.com/?GId=12&amp;Desc=Asp-.Net-GridView">Asp .Net GridView</a> </strong>, I am not going to explain again how to get the data and bind the data from database.</p>
<p>2) Since this article is based on Ajax, without Ajax control kit the sample can not be even compiled. So please get the Ajax tool kit from the ASP.Net website.</p>
<p><strong>DataView and RowFilter</strong><br />
As we use DataView for various DataBinding, I have opted to use DataView‘s RowFilter property over the DataTable‘s Select method. I don’t like the select method, because it returns the collection and binding or reapply other tasks like sorting is a pain.  Once the RowFilter is applied the DataView has to be bound again. This renders the filtered data in the GridView.</p>
<p><strong>Enable Ajax using AjaxControlKit</strong><br />
As I have explained in earlier articles under Ajax categories, AjaxControlKit has to be installed. AjaxControlKit is available for download in CodePlex. Once it is installed, the controls will be available in the toolbox. Drop the controls ScriptManager, and UpdatePanel from the toolbox. Only one ScriptManager is allowed per page. Declare it only once. UpdatePanel can be used to update the contents during the PostBack. Wrap the controls with UpdatePanel which should be ajaxified. Finally add the trigger for the control and its event. CheckBoxList is ajaxified now.</p>
<p><strong>For Source Code and related information</strong></p>
<p><strong><a href="http://www.vbknowledgebase.com/?Id=124&amp;Desc=Asp.Net-Ajax-GridView-Filter">Asp.Net Ajax GridView Filter</a></strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gridview.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gridview.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gridview.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gridview.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gridview.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gridview.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gridview.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gridview.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gridview.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gridview.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gridview.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gridview.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gridview.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gridview.wordpress.com/80/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gridview.wordpress.com&amp;blog=9845954&amp;post=80&amp;subd=gridview&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gridview.wordpress.com/2011/02/05/ajaxified-row-filter-for-asp-net-gridview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ac54478ac87629d40a409377ee94ba78?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">VB</media:title>
		</media:content>
	</item>
		<item>
		<title>How to build a Horizontal List using an ASP.net Repeater</title>
		<link>http://gridview.wordpress.com/2011/02/03/horizontal-list/</link>
		<comments>http://gridview.wordpress.com/2011/02/03/horizontal-list/#comments</comments>
		<pubDate>Thu, 03 Feb 2011 03:32:18 +0000</pubDate>
		<dc:creator>VB</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gridview.wordpress.com/?p=77</guid>
		<description><![CDATA[Have you ever tried generating a horizontal list in ASP.Net?  There is no control in ASP.Net which natively supports this (to my knowledge).  Radio button list supports the list’s orientation as horizontal. But you can not use radio button list for a menu. I am trying to use a repeater to fabricate the menu so [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gridview.wordpress.com&amp;blog=9845954&amp;post=77&amp;subd=gridview&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Have you ever tried generating a horizontal list in ASP.Net?  There is no control in ASP.Net which natively supports this (to my knowledge).  Radio button list supports the list’s orientation as horizontal. But you can not use radio button list for a menu. I am trying to use a repeater to fabricate the menu so that you can add the other onClick events later to bind to the respective actions.</p>
<p><strong>Why ASP.Net over the other data controls.</strong><br />
ASP.net repeater is a very simple control which just repeats the items defined in the ItemTemplate. It does not add anything other than this. This gives us more possibilities in generating the code as we like. And for this menu we don’t need any paging or runtime sorting options. So with a little CSS and JavaScript we are ready to use the horizontal menu we created.</p>
<p><strong>Bind the Data</strong><br />
Please refer to the data controls section for how to connect the data and bind the data controls. I am just skipping those areas, since I have explained in few articles in the earlier days in detail.</p>
<p><strong>Constructing a menu</strong><br />
To get a menu we need two divs. One is the outer div(we call it as OuterPanel) and another one is the div used for each menu item. So we place the repeater inside the OuterPanel. Let the repeater handle the placing of inner divs(we call as ItemPanel). After assigning the proper class names, the application is ready to run.</p>
<p>If you run at this stage you will notice that the ItemPanels are placed vertically. That is the default behaviour of the divs. They don’t sit horizontally. To bring the menu items floating next to each other we need to use the property float:left for the menu items.</p>
<p><strong>Fixing few for a decent looking menu</strong><br />
At this stage if you run, you can notice the ItemPanels are overlapping the OuterPanel. This is due to the float:left assigned to the ItemPanels. To fix this you can add float:left to the OuterPanel. Apply some padding, margin, background the menu will look decent.</p>
<p><strong>For Screen capture and the source code visit <a href="http://www.vbknowledgebase.com/?Id=155&amp;Desc=Asp.Net-Repeater-Horizontal-List-Menu">Asp.Net Repeater Horizontal List Menu</a></strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gridview.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gridview.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gridview.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gridview.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gridview.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gridview.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gridview.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gridview.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gridview.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gridview.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gridview.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gridview.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gridview.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gridview.wordpress.com/77/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gridview.wordpress.com&amp;blog=9845954&amp;post=77&amp;subd=gridview&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gridview.wordpress.com/2011/02/03/horizontal-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ac54478ac87629d40a409377ee94ba78?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">VB</media:title>
		</media:content>
	</item>
		<item>
		<title>Datagridview Printing in VB.Net</title>
		<link>http://gridview.wordpress.com/2010/12/30/datagridview-printing-in-vb-net/</link>
		<comments>http://gridview.wordpress.com/2010/12/30/datagridview-printing-in-vb-net/#comments</comments>
		<pubDate>Thu, 30 Dec 2010 06:32:38 +0000</pubDate>
		<dc:creator>VB</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gridview.wordpress.com/?p=71</guid>
		<description><![CDATA[Printing Datagridview using VB.Net There will be situations to just print a DataGridView in a application than designing again the columns and rows in a Crystal Report. But in .Net there is no straight forward way to do this or in other words this is not supported natively. To print the Datagridview we need to draw [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gridview.wordpress.com&amp;blog=9845954&amp;post=71&amp;subd=gridview&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>Printing Datagridview using VB.Net</h2>
<p>There will be situations to just print a DataGridView in a application than designing again the columns and rows in a Crystal Report. But in .Net there is no straight forward way to do this or in other words this is not supported natively. To print the Datagridview we need to draw all the objects using Graphics Object given in the PrintDocument before calling print method in the respective PrintDocument. Printing the gridview using <a title="all in one printers" href="http://www.allinoneprinters.biz">All In One Printers </a>is not that much difficult task if following is done properly.</p>
<h3>PrintDocument and the Graphics Object</h3>
<p>So as I earlier said we need to actually draw all including text using the Graphics object.  The print document needs to be prepared before actual printing starts. So we can use the event PrintPage, in this event we can draw all the objects as we need.</p>
<h3>Draw the DataGridView like a table using lines</h3>
<p>To get a tabular data to represent the DataGridView, we need to do the following<br />
• Draw an outer rectangle as the border to table<br />
• Draw a line for every row<br />
• Draw a line for every column while iterating the cell<br />
• Draw the cell value as text<br />
All the above said items can be drawn with the help of the DataGridView’s native properties, Left, Top, Height, Width, Row.Hieght, and Column. Width</p>
<p>Refer source code <a href="http://www.vbnettutorial.net/?Id=132&amp;Desc=VB.Net-Print-Datagridview-in-WinForms">VB.Net Print Datagridview in WinForms</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gridview.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gridview.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gridview.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gridview.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gridview.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gridview.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gridview.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gridview.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gridview.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gridview.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gridview.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gridview.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gridview.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gridview.wordpress.com/71/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gridview.wordpress.com&amp;blog=9845954&amp;post=71&amp;subd=gridview&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gridview.wordpress.com/2010/12/30/datagridview-printing-in-vb-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ac54478ac87629d40a409377ee94ba78?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">VB</media:title>
		</media:content>
	</item>
		<item>
		<title>Asp.net Array List and databinding</title>
		<link>http://gridview.wordpress.com/2010/06/16/asp-net-array-list-and-databinding/</link>
		<comments>http://gridview.wordpress.com/2010/06/16/asp-net-array-list-and-databinding/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 01:41:38 +0000</pubDate>
		<dc:creator>VB</dc:creator>
				<category><![CDATA[Databinding]]></category>

		<guid isPermaLink="false">http://gridview.wordpress.com/?p=66</guid>
		<description><![CDATA[DataBinding is an integral part in programming User Interfaces. It really reduces the work load of populating the data into the control from respective DataSource. The DataSource is usually impletemted an interface called IEnumerator. It implies that all the objects that implement an IEnumerator interface can be used to DataBind the controls. Binding a GridView with ArrayList [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gridview.wordpress.com&amp;blog=9845954&amp;post=66&amp;subd=gridview&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>DataBinding is an integral part in programming User Interfaces. It really reduces the work load of populating the data into the control from respective DataSource. The DataSource is usually impletemted an interface called IEnumerator. It implies that all the objects that implement an IEnumerator interface can be used to DataBind the controls.</p>
<p><strong>Binding a GridView with ArrayList</strong></p>
<p>Though Binding a GridView is very simple task in VB.Net, the following is essential.</p>
<ul>
<li>Understanding   how to use a DataSource </li>
<li>Once the DataSource is given how to bind the data.</li>
</ul>
<p><strong>ArrayList OR Array?</strong><br />
Since the ArrayList is easier to use I have chosen ArrayList over array. Array needs to be re dim every time when the collection is changed. If you want to add a new item then you have to re dim the array. But ArrayList are much easier to work with. The reason behind is, it is something like collection in Classic VB. You can add, remove the items easily. There is absolutely no need to worry about the count of items. As a new item will be added, removed and the count will be calculated automatically</p>
<p><strong>GridView Row </strong><strong>Sorting<br />
</strong><br />
Since the GridView natively supports the sorting, I tried to sort the ArrayList and rebind again. This is really much easier. Call the sort method of the ArrayList and assign the DataSource again and call the DataBind. That’s it the GridView will be sorted.</p>
<p><strong>For source code and more information read more here </strong><a href="http://www.vbknowledgebase.com/?Id=146&amp;Desc=Asp.Net-Array-List-DataBinding-and-Sorting"><strong>Asp.Net Array List</strong></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gridview.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gridview.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gridview.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gridview.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gridview.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gridview.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gridview.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gridview.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gridview.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gridview.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gridview.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gridview.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gridview.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gridview.wordpress.com/66/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gridview.wordpress.com&amp;blog=9845954&amp;post=66&amp;subd=gridview&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gridview.wordpress.com/2010/06/16/asp-net-array-list-and-databinding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ac54478ac87629d40a409377ee94ba78?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">VB</media:title>
		</media:content>
	</item>
		<item>
		<title>LinkButton in a GridView to delete</title>
		<link>http://gridview.wordpress.com/2010/06/02/linkbutton-in-a-gridview-to-delete/</link>
		<comments>http://gridview.wordpress.com/2010/06/02/linkbutton-in-a-gridview-to-delete/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 04:14:51 +0000</pubDate>
		<dc:creator>VB</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gridview.wordpress.com/?p=61</guid>
		<description><![CDATA[We can delete a row in a GridView several ways. But I am here to explain how to use a LinkButton to delete a row. LinkButton is a fantastic control for raising a PostBack at the same time it is very flexible to style and format using style sheets and CSS. I usually take the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gridview.wordpress.com&amp;blog=9845954&amp;post=61&amp;subd=gridview&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We can delete a row in a GridView several ways. But I am here to explain how to use a LinkButton to delete a row. LinkButton is a fantastic control for raising a PostBack at the same time it is very flexible to style and format using style sheets and CSS.</p>
<p>I usually take the Northwind sample database for articles. So in this article I will be using the products table.</p>
<p><strong>How Use LinkButton inside a GridView</strong></p>
<p>You can use the LinkButton inside a GridView with the help of TemplateField. Use the ItemTemplate in the TemplateField for displaying the LinkButton. To get the clicked row information in the code behind, LinkButton has two properties mainly to interact. That is CommandName and CommandArgument.</p>
<p><strong>CommandName</strong></p>
<p>CommandName can be used to define what the action the LinkButton is going to be performed. In our case it is going to perform Delete but wait don’t use delete as a CommandName. The reason behind is, the button field in the GridView is already using the delete name. So you will not be getting the RowCommand event. So always be specific on actions and try to avoid the inbuilt action commands. Unless you are purposely raising the delete command please stay away from using the built-in action commands.</p>
<h3>CommandArgument</h3>
<p>Now it is time to pass the active data (in our case it is a primary key which is product id). The easiest way to pass the product id from markup to code behind on PostBack is using the command argument.</p>
<p> To bind the product id to the LinkButton using command argument,</p>
<p>&#8216;&lt;%# DataBinder.Eval(Container.DataItem, &#8220;ProductID&#8221;)%&gt;&#8217;&gt;</p>
<p><strong>read more with source code here </strong><a href="http://www.vbknowledgebase.com/?Id=145&amp;Desc=LinkButton-GridView"><strong>LinkButton GridView</strong></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gridview.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gridview.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gridview.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gridview.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gridview.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gridview.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gridview.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gridview.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gridview.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gridview.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gridview.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gridview.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gridview.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gridview.wordpress.com/61/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gridview.wordpress.com&amp;blog=9845954&amp;post=61&amp;subd=gridview&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gridview.wordpress.com/2010/06/02/linkbutton-in-a-gridview-to-delete/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ac54478ac87629d40a409377ee94ba78?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">VB</media:title>
		</media:content>
	</item>
		<item>
		<title>VB.Net DataGridView Databinding</title>
		<link>http://gridview.wordpress.com/2010/05/05/vb-net-datagridview-databinding/</link>
		<comments>http://gridview.wordpress.com/2010/05/05/vb-net-datagridview-databinding/#comments</comments>
		<pubDate>Wed, 05 May 2010 02:36:12 +0000</pubDate>
		<dc:creator>VB</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gridview.wordpress.com/?p=58</guid>
		<description><![CDATA[DataGridView is very simple in .Net. Provided the knowledge of connecting to database, executing the SQL Select Queries and filling the dataset with the data fetched is necessary. While data reader also can be used for light weight read only purposes, I am explaining here with dataset. Since the coming articles in this website will [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gridview.wordpress.com&amp;blog=9845954&amp;post=58&amp;subd=gridview&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>DataGridView is very simple in .Net. Provided the knowledge of connecting to database, executing the SQL Select Queries and filling the dataset with the data fetched is necessary. While data reader also can be used for light weight read only purposes, I am explaining here with dataset. Since the coming articles in this website will refer back this article for DataBinding samples</p>
<p><strong>Connect To DataBase</strong></p>
<p>We are going to use the following namespaces for using the database related objects in ADO.Net,</p>
<p>Import System.Data<br />
Import System.Data.SqlClient</p>
<p>Next step is to get the connection to the database. Since we have already decided to use the SqlClient, we have to use SqlConnection to open a connection as follows.</p>
<p>1. Initialize the connection object</p>
<p>Dim ConnectionToFetch As New SqlConnection</p>
<p>2. Specify the connection string</p>
<p>ConnectionToFetch.ConnectionString = &#8220;Server= localhost\SQLEXPRESS;Database=Northwind;Trusted_Connection=true&#8221;</p>
<p>3. Open the connection</p>
<p>ConnectionToFetch.Open()</p>
<p>Note: Northwind database can be obtained from MSDN</p>
<p>http://blogs.msdn.com/smartclientdata/archive/2005/11/02/488258.aspx</p>
<p>Next step is to use the opened connection to fetch data. We have several options to fetch the data. But in this example I am going to use SqlDataAdapter and DataSet.</p>
<p><strong>Read the Data</strong></p>
<p>1. Initialize the SqlDataAdapter and DataSet</p>
<p>Dim SampleDataAdapter As New SqlDataAdapter<br />
Dim SampleSource As New DataSet</p>
<p>2. Create a command object</p>
<p>3. Connect the command object with the opened active connection</p>
<p>4. Assign the command object to the SqlDataAdapter</p>
<p>Dim SelectQry = &#8220;SELECT * FROM Products &#8220;</p>
<p>Dim SampleCommand As New SqlCommand()<br />
Dim SampleDataAdapter = New SqlDataAdapter()<br />
SampleCommand.CommandText = SelectQry<br />
SampleCommand.Connection = Connection<br />
SampleDataAdapter.SelectCommand = SampleCommand</p>
<p>5. Use SqlDataAdapter’s fill method to fill the dataset</p>
<p>ConnectionToFetch.Fill(SampleSource)</p>
<p>6. Close the connection</p>
<p>ConnectionToFetch.Close()</p>
<p>7. Assign the dataset to the GridView’s Datasource</p>
<p>GridView1.DataSource = dsGrid.Tables(0)</p>
<p>8. Bind the GridView with Dataset</p>
<p>GridView1.DataBind()</p>
<p><strong>Please find the source code here (</strong><a href="http://www.vbnettutorial.net/?Id=125&amp;Desc=VB.Net-DataGridView"><strong>VB.Net DataGridView</strong></a><strong>)</strong></p>
<p><em>Article written by Pon Saravanan</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gridview.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gridview.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gridview.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gridview.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gridview.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gridview.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gridview.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gridview.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gridview.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gridview.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gridview.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gridview.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gridview.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gridview.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gridview.wordpress.com&amp;blog=9845954&amp;post=58&amp;subd=gridview&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gridview.wordpress.com/2010/05/05/vb-net-datagridview-databinding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ac54478ac87629d40a409377ee94ba78?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">VB</media:title>
		</media:content>
	</item>
		<item>
		<title>GridView Alphabetical Paging in BottomPagerRow</title>
		<link>http://gridview.wordpress.com/2010/03/17/gridview-alphabetical-paging-in-bottompagerrow/</link>
		<comments>http://gridview.wordpress.com/2010/03/17/gridview-alphabetical-paging-in-bottompagerrow/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 05:41:34 +0000</pubDate>
		<dc:creator>VB</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gridview.wordpress.com/?p=50</guid>
		<description><![CDATA[Sometimes the data will be more helpful if presented in a nice and user friendly manner. I have noticed this in the hierarchical GridView which I had explained earlier in previous articles. Like that, this paging also gives an excellent way to group and present the data on the screen. Whenever there is a need [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gridview.wordpress.com&amp;blog=9845954&amp;post=50&amp;subd=gridview&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes the data will be more helpful if presented in a nice and user friendly manner. I have noticed this in the hierarchical GridView which I had explained earlier in previous articles. Like that, this paging also gives an excellent way to group and present the data on the screen. Whenever there is a need of alphabetical lists such as names, products, cities, you may try the Alphabetical Paging.</p>
<p>Wait! There is no built in support for Alphabetical Paging. So there is a need of this article with complete working source code. I have coded this as far as I can explain easily.Look at the screen shots to have a fair idea about how this suppose to work.</p>
<h3>Construct the Pager Row</h3>
<p>For this example, the buttons for all the alphabets will be placed in the bottom pager. Since totally 26 buttons to be created, to make it simple I created a function to create all the buttons. Just after DataBinding the controls have to be created i.e. the function has to be called. When creating buttons, using the command argument the alphabets are passed and command name is given as PAGINATE for differentiate the command from other commands.</p>
<h3>Constraints in Pager Row control creation</h3>
<p>1) To wire up the events in asp.net, the controls which are fired the PostBack should be available during the PostBack. Otherwise the event will not be mapped to the respective control. As a result just a PostBack only will happen. Since we are creating the controls at the code behind, the above rule applies.</p>
<p>2) Due to the nature for alphabetical paging, we will display/enable the alphabetical buttons even though there is no data for that particular alphabet. That means when you click on that letter, you will be served with the no records found (technically, the EmptyDataTemplate will be displayed). If the EmptyDataTemplate is displayed, you will no longer see the pager row. As a result you will be in dead end and you can not proceed to click on further letters. To workaround this I have recreated once again the pager row at the EmptyDataTemplate.  Finally a reusable function is written for catering both the cases EmptyDataTemplate and pager template at footer.</p>
<h3>Paging with the support of RowCommand</h3>
<p>The pagination is provided to the GridView with the help of RowCommand. As we have already seen the link buttons with alphabets are assigned with command name, command argument appropriately. So in the row command event the respective alphabet can be fetched. Based on that letter, the data can be fetched from the database. After binding the data the page row has to be recreated.</p>
<p>As I have already mentioned, while creating the pager row, the current DataSource has to be verified for creating pager row for footer or EmptyDataTemplate.</p>
<p>For complete source code please refer here(<a href="http://www.vbknowledgebase.com/?Id=137&amp;Desc=GridView-Alphabetical-Paging">GridView Alphabetical Paging</a>)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gridview.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gridview.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gridview.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gridview.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gridview.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gridview.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gridview.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gridview.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gridview.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gridview.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gridview.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gridview.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gridview.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gridview.wordpress.com/50/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gridview.wordpress.com&amp;blog=9845954&amp;post=50&amp;subd=gridview&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gridview.wordpress.com/2010/03/17/gridview-alphabetical-paging-in-bottompagerrow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ac54478ac87629d40a409377ee94ba78?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">VB</media:title>
		</media:content>
	</item>
		<item>
		<title>Hierarchical GridView</title>
		<link>http://gridview.wordpress.com/2010/02/23/hierarchical-gridview/</link>
		<comments>http://gridview.wordpress.com/2010/02/23/hierarchical-gridview/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 05:28:32 +0000</pubDate>
		<dc:creator>VB</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gridview.wordpress.com/2010/02/23/hierarchical-gridview/</guid>
		<description><![CDATA[Hierarchical GridView Using TemplateField I usually choose a TreeView for this kind of hierarchical data or I choose ASP.Net menu. But there are some situations you may need to have various controls on each node. If this is your case then the Asp.Net Hierarchical GridView is right choice. But wait one moment, there is no   [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gridview.wordpress.com&amp;blog=9845954&amp;post=49&amp;subd=gridview&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>Hierarchical GridView Using TemplateField</h2>
<p>I usually choose a TreeView for this kind of hierarchical data or I choose ASP.Net menu. But there are some situations you may need to have various controls on each node. If this is your case then the Asp.Net Hierarchical GridView is right choice. But wait one moment, there is no   Hierarchical Grid  as we have in Classic VB.</p>
<p>However we can still get a Asp.Net Hierarchical GridView, by using a GridView inside another GridView’s TemplateField. This example I am using a label with ‘+’ (Plus) sign for expanding and a ‘-‘(Minus) sign for collapsing. This is handled by JavaScript. I have used CSS to style the label so the user will click on the (+) and (-) without further instructions.</p>
<h3>RowDataBound to access the inner GridView</h3>
<p>The inner GridView is named as GridView2 and it is placed inside the ItemTemplate in the TemplateField of the GridView1. So to access each row the RowDataBound is the right event. Further all the controls can be accessed in a row using the rows FindControl Method.</p>
<h3>Hierarchical Data</h3>
<p>For simpler explanation I always use the Northwind Database. So for this example also I have chosen the Categories and products. Category is used in the outer GridView. And the Product is used in the inner GridView. In the RowDataBound event using the DataItem property we can access the Category ID of the respective row. Then the Category ID is used to fetch the respective Product rows from the Database.</p>
<p>Read More with full source code here (<a href="http://www.vbknowledgebase.com/?Id=125&amp;Desc=Asp.Net-Hierarchical-GridView">Hierarchical </a><a href="http://www.vbknowledgebase.com/?Id=125&amp;Desc=Asp.Net-Hierarchical-GridView">Asp.Net</a> <a href="http://www.vbknowledgebase.com/?Id=125&amp;Desc=Asp.Net-Hierarchical-GridView">GridView</a>)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gridview.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gridview.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gridview.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gridview.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gridview.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gridview.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gridview.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gridview.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gridview.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gridview.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gridview.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gridview.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gridview.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gridview.wordpress.com/49/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gridview.wordpress.com&amp;blog=9845954&amp;post=49&amp;subd=gridview&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gridview.wordpress.com/2010/02/23/hierarchical-gridview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ac54478ac87629d40a409377ee94ba78?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">VB</media:title>
		</media:content>
	</item>
		<item>
		<title>Calendar inside a ASP.Net GridView</title>
		<link>http://gridview.wordpress.com/2010/02/09/calendar-inside-a-asp-net-gridview/</link>
		<comments>http://gridview.wordpress.com/2010/02/09/calendar-inside-a-asp-net-gridview/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 07:00:46 +0000</pubDate>
		<dc:creator>VB</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gridview.wordpress.com/?p=45</guid>
		<description><![CDATA[Calendar in a GridView template Unlike other controls, calendar is taking too much of space for its usage. In most of the applications calendar will be hidden just after selecting the date. Earlier days in classic asp, we used a popup to load it on demand (sometimes used inline as well).  Here in this sample [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gridview.wordpress.com&amp;blog=9845954&amp;post=45&amp;subd=gridview&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>Calendar in a GridView template</h2>
<p>Unlike other controls, calendar is taking too much of space for its usage. In most of the applications calendar will be hidden just after selecting the date. Earlier days in classic asp, we used a popup to load it on demand (sometimes used inline as well).  Here in this sample we are going to use a calendar control inside a GridView’s TemplateField. To make it close to real time, I have added a Textbox and a button to pop the calendar.</p>
<h3>Show Hide calendar</h3>
<p>As already explained to reduce the space used by calendar, it is easier to toggle visibility using a JavaScript. Since the calendar control is going to be at each row, the respective control’s client ids have to be passed. Otherwise we can not access those controls from JavaScript.</p>
<h3>Attach Client Events at RowDataBound</h3>
<p>To pass the Client ID’s of all the required controls to JavaScript, the right place is the RowDataBound event. This event will be fired for every rows while binding data. So the client script can be prepared added to attributes of the control. Remember to return false at the end, otherwise there will be an unnecessary PostBack to server.</p>
<h3>Handling Calendar OnSelectionChanged</h3>
<p>Remember the calendar control is not available directly.  It is contained in the GridView control’s ItemTemplate. In order to handle this event, we can either use a RowCommand, or a specific event to handle this.</p>
<p>I have chosen the second model for this sample. In this specific event, the control which has raised the event can be fetched using the first parameter named as sender.<br />
Using this we can traverse back to fetch the row and the calendar’s siblings. We have fetched the textbox control same way, assigned the selected date to it.</p>
<p>For source code please refer (<a href="http://www.vbknowledgebase.com/?Id=127&amp;Desc=Asp.net-GridView-Calendar">GridView Calendar</a>)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gridview.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gridview.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gridview.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gridview.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gridview.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gridview.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gridview.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gridview.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gridview.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gridview.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gridview.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gridview.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gridview.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gridview.wordpress.com/45/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gridview.wordpress.com&amp;blog=9845954&amp;post=45&amp;subd=gridview&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gridview.wordpress.com/2010/02/09/calendar-inside-a-asp-net-gridview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ac54478ac87629d40a409377ee94ba78?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">VB</media:title>
		</media:content>
	</item>
	</channel>
</rss>
