Visual Basic
C#
C# | Copy Code |
---|---|
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Netcad.Netigma; using System.Data; using System.Web.UI.WebControls; using DevExpress.Web; using System.Web.UI; using Netcad.Netigma.Web; namespace HelpDocumentExamples { public class DataAnalyserExample : INetigmaDataAnalyzer, INetigmaGroupRenderer { #region INetigmaDataAnalyzer members public object CreateControl(Netcad.Web.UI.StringParser.ParameterParser Options, IGUIState DataGuIState) { INetigmaDomain domain = DataGuIState.GetObject(GUIObjectType.NetigmaDomain) as INetigmaDomain; IDatasetInfo dataSetInfo = DataGuIState.GetObject(GUIObjectType.DatasetInfoObject) as IDatasetInfo; DataTable dt = dataSetInfo.GetData(); Label summaryLabel = new Label(); summaryLabel.Text = string.Format("{0} rows selected",dt.Rows.Count); return summaryLabel; } public INetigmaDataAnalyzer Clone() { return this.MemberwiseClone() as INetigmaDataAnalyzer; } public string Name { get { return "ExampleDataAnalyser"; } } public string DisplayName { get { return "My Example Data Analyser"; } } #endregion #region INetigmaGroupRenderer private string ClientIdSuffix { get { return this.GetHashCode().ToString().Replace("-", "_"); } } public object GetGroupControl(IViewResult viewResult, IGUIState state) { PlaceHolder container = new PlaceHolder(); Control innerControl = this.CreateControl(null, state) as Control; NetigmaHyperLink link = new NetigmaHyperLink(); link.Text = "Show Sum"; ASPxPopupControl popup = new ASPxPopupControl(); popup.HeaderText = "Summary"; popup.ClientInstanceName = "popup_" + ClientIdSuffix; popup.Modal = true; popup.PopupHorizontalAlign = DevExpress.Web.PopupHorizontalAlign.WindowCenter; popup.PopupVerticalAlign = DevExpress.Web.PopupVerticalAlign.WindowCenter; link.Attributes["onclick"] = popup.ClientInstanceName + ".Show();"; popup.Controls.Add(innerControl); container.Controls.Add(popup); container.Controls.Add(link); return container; } #endregion } } |
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family