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
Hi
i have 1 web grid, and when i doube click on a cell, i want it to switch to a different datasource, with different columns. This should work, and i get to where i hit the code, and it shows it switching to the othe datasource, and setitng the columns. But he datasource never fires and the columns dont change. What am i doing wrong?
this.WebGridCollections.RootTable.Columns.Clear();
GridFilterExpression userFilter = GridFilterExpression.CreateNewFilter(new Guid(theQuery));
string filterString = userFilter.BuildXml();
if (gridType == GridTypes.Customers)
{
this.WebGridCollections.DataSourceID = this.ISDataSource1.ID;
this.ISDataSource1.Tables.GetNamedItem("Customers").SelectParameters.Add("filterExpression", filterString);
this.WebGridCollections.LayoutSettings.PagingSize = 5000;
this.WebGridCollections.RootTable.Columns.Add(new ISNet.WebUI.WebGrid.WebGridColumn());
this.WebGridCollections.RootTable.Columns.Add(new ISNet.WebUI.WebGrid.WebGridColumn("Icon", "Icon", " ", Unit.Pixel(20), ColumnType.Image, EditType.NoEdit, string.Empty));
this.WebGridCollections.RootTable.Columns.Add(new ISNet.WebUI.WebGrid.WebGridColumn("DisplayName", "DisplayName", SessionSettings.GetHosterDefinedAdmin("DISPLAY_NAMEText"), Unit.Pixel(250), ColumnType.HyperLink, EditType.NoEdit, string.Empty));
this.WebGridCollections.RootTable.Columns.Add(new ISNet.WebUI.WebGrid.WebGridColumn("CustomerCode", "CustomerCode", SessionSettings.GetHosterDefinedAdmin("CUSTOMER_CODEText"), Unit.Pixel(80), ColumnType.HyperLink, EditType.NoEdit, string.Empty));
this.WebGridCollections.RootTable.Columns.Add(new ISNet.WebUI.WebGrid.WebGridColumn("GUID", "GUID", " ", Unit.Pixel(1), ColumnType.Text, EditType.NoEdit, string.Empty));
this.WebGridCollections.RootTable.Columns.Add(new ISNet.WebUI.WebGrid.WebGridColumn("Type", "Type", SessionSettings.GetHosterDefinedAdmin("MSG_Type"), Unit.Pixel(40), ColumnType.Text, EditType.NoEdit, string.Empty));
this.WebGridCollections.RootTable.Columns.Add(new ISNet.WebUI.WebGrid.WebGridColumn("Location", "Location", SessionSettings.GetHosterDefinedAdmin("MSG_Location"), Unit.Pixel(40), ColumnType.Text, EditType.NoEdit, string.Empty));
this.WebGridCollections.RootTable.Columns.Add(new ISNet.WebUI.WebGrid.WebGridColumn("IsDisabled", "IsDisabled", " ", Unit.Pixel(40), ColumnType.Text, EditType.NoEdit, string.Empty));
this.WebGridCollections.RootTable.Columns.Add(new ISNet.WebUI.WebGrid.WebGridColumn("StatusFailedMessage", "StatusFailedMessage", " ", Unit.Pixel(40), ColumnType.Text, EditType.NoEdit, string.Empty));
this.WebGridCollections.RootTable.Columns.Add(new ISNet.WebUI.WebGrid.WebGridColumn("Status", "Status", SessionSettings.GetHosterDefinedAdmin("MSG_Status"), Unit.Pixel(40), ColumnType.Image, EditType.NoEdit, string.Empty));
}
else
this.WebGridCollections.DataSourceID = this.ISDataSource2.ID;
this.ISDataSource2.Tables.GetNamedItem("Users").SelectParameters.Add("filterExpression", filterString);
this.WebGridCollections.LayoutSettings.PagingSize = SiteVariables.StartPagingCount();
this.WebGridCollections.RootTable.Columns.Add(new ISNet.WebUI.WebGrid.WebGridColumn("FirstName", "FirstName", SessionSettings.GetHosterDefinedAdmin("FIRST_NAME"), Unit.Pixel(150), ColumnType.Text, EditType.NoEdit, string.Empty));
this.WebGridCollections.RootTable.Columns.Add(new ISNet.WebUI.WebGrid.WebGridColumn("LastName", "LastName", SessionSettings.GetHosterDefinedAdmin("LAST_NAME"), Unit.Pixel(250), ColumnType.Text, EditType.NoEdit, string.Empty));
this.WebGridCollections.RootTable.Columns.Add(new ISNet.WebUI.WebGrid.WebGridColumn("CompanyGuid", "CompanyGuid", " ", Unit.Pixel(1), ColumnType.Text, EditType.NoEdit, string.Empty));
this.WebGridCollections.RootTable.Columns.Add(new ISNet.WebUI.WebGrid.WebGridColumn("Email", "Email", SessionSettings.GetHosterDefinedAdmin("EMAIL"), Unit.Pixel(150), ColumnType.Text, EditType.NoEdit, string.Empty));
this.WebGridCollections.RootTable.Columns.Add(new ISNet.WebUI.WebGrid.WebGridColumn("IsDisabled", "IsDisabled", " ", Unit.Pixel(1), ColumnType.Text, EditType.NoEdit, string.Empty));
Hi Eric,
Sorry for late responses. I've made an sample regarding this problem. This issue might be happen because there is different behavior in WebGrid when it bound to Data Source Control. You can bound the data source control with WebGrid in Page_Load event and you can retrieve its structure on PrepareDataBinding event. You can switch the Data source control by using WebGrid RefreshAll() function. I also attach the sample here. Hope this helps.
Regards,Bernard
I've made a sample regarding your scenario. In my sample, I'm using Northwind database as WebGrid's DataSource. If possible, could you check my sample and tell me if there's anything wrong from my sample? Look forward to hear any feedback from you so I can help you further.
Ok i will explain again. I have 2 (TWO) ISDataSources, and want to switch betwee them. your sample has nothing to do with that. When i switch to the second data source, it doesnt change the columns, nor does it call the second data source GetData.
I have included the files.
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