Switching between 2 datasources

3 replies. Last post: January 8, 2013 6:05 AM by Bernard Xiang
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
Eric HanigMember

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("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("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("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("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));

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));

}

Eric
All times are GMT -5. The time now is 12:53 AM.
Previous Next