﻿<?xml version="1.0" encoding="utf-8"?><rss 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:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebGrid Enterprise - webgrid, RebindDataSource, InitializeDataSource, InitializePostBack</title><link>http://www.intersoftsolutions.com/Community/WebGrid/webgrid-RebindDataSource-InitializeDataSource-InitializePostBack/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>webgrid, RebindDataSource, InitializeDataSource, InitializePostBack</title><link>http://www.intersoftsolutions.com/Community/WebGrid/webgrid-RebindDataSource-InitializeDataSource-InitializePostBack/</link><pubDate>Fri, 04 Dec 2009 04:32:43 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;I enclosed one simple sample that shows how to bind dataset on InitializeDataSource event and retrieve WebGrid structure on PrepareDataBinding event.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;&lt;strong&gt;WebGrid InitializeDataSource event&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;All codes related to the assignment of data source to the WebGrid component should be placed here. Since in this event, an instance of DataSourceEventArgs can be obtained, so the assignment code should be:&lt;br /&gt;e.DataSource = DSName; //instead of WebGrid1.DataSource = DSName&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt; codes: " 9pt;?="" font-size:="" #1f497d;="" color:="" ui?,?sans-serif?;="" ?segoe="" font-family:=""&gt;&lt;strong&gt;WebGrid PrepareDataBinding event&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;WebGrid has successfully binded its DataSource which defined using e.DataSource. In this event, developers can conveniently populate all the columns structure. There are many cases that developers often forgot to place all “object creation” codes under !IsPostBack condition, so please remember to place WebGrid1.RetrieveStructure() or WebGrid1.RetrieveHierarchicalStructure() under !IsPostBack condition.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;There are cases such as users has utilized resizing columns, sorting and grouping features and invoked PostBack to the server, but after the PostBack all the features applied are overrided back to the first configuration erasing all features that have been applied.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>webgrid, RebindDataSource, InitializeDataSource, InitializePostBack</title><link>http://www.intersoftsolutions.com/Community/WebGrid/webgrid-RebindDataSource-InitializeDataSource-InitializePostBack/</link><pubDate>Thu, 03 Dec 2009 00:10:40 GMT</pubDate><dc:creator>p.belanger@cgi.com</dc:creator><description>&lt;pre&gt;Our application is using Webgrid 4.0. I am trying to adapt it to WebGrid 7.0.&lt;/pre&gt;&lt;pre&gt;I am having problems with converting the code in the InitializeDataSource and InitializePostBack.&lt;/pre&gt;&lt;pre&gt;The code below was used in 4.0 to bind a dataset to the grid. Since in 7.0 the InitalializeDatSource event must return a Dataset, where am I suppose to call the ReBindDataSource? I did not see any sample code showing where it should be used. &lt;/pre&gt;&lt;pre&gt;And since ClearCachedDataSource() followed by RebindDataSource() will recall InitializeDataSource I will be in a recursive loop!&lt;/pre&gt;&lt;pre&gt;Unless InitializeDataSource does a RebindDataSource automatically?&lt;/pre&gt;&lt;pre&gt;Can you help me clarify these issues?&lt;/pre&gt;&lt;pre&gt;		Private Sub InitializeDataGrid()
			Dim objDS As DataSet = clsSubCertification.GetPackages(intExecutiveID, intPeriodID)
			With dgPackages
				'Assign Data
				.ClearCachedDataSource()
				.DataSource = objDS
				
				.DataMember = objDS.Tables(0).TableName
				.RebindDataSource()
	

				.RootTable.SelfReferencingSettings.Enabled = True
				.RootTable.SelfReferencingSettings.ChildDataMember = "ManagerID"
				.RootTable.SelfReferencingSettings.ParentDataMember = "UserID"
						.RootTable.SelfReferencingSettings.LoadOnDemand = False
				.RootTable.SelfReferencingSettings.ExpandColumnMember = "FullName"
				.RootTable.SelfReferencingSettings.ExpandColumnInnerTextPadding = 4
				.RootTable.SelfReferencingSettings.FitColumnOnExpand = True
			End With
			
		End Sub&lt;/pre&gt;
</description></item></channel></rss>