iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Our application is using Webgrid 4.0. I am trying to adapt it to WebGrid 7.0.
I am having problems with converting the code in the InitializeDataSource and InitializePostBack.
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.
And since ClearCachedDataSource() followed by RebindDataSource() will recall InitializeDataSource I will be in a recursive loop!
Unless InitializeDataSource does a RebindDataSource automatically?
Can you help me clarify these issues?
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
I enclosed one simple sample that shows how to bind dataset on InitializeDataSource event and retrieve WebGrid structure on PrepareDataBinding event.
WebGrid InitializeDataSource event
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:e.DataSource = DSName; //instead of WebGrid1.DataSource = DSName
WebGrid PrepareDataBinding event
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.
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.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname