public void InstantiateIn(Control container) { ASPxHyperLink link = new ASPxHyperLink(); GridViewDataItemTemplateContainer gridContainer = (GridViewDataItemTemplateContainer)container; //link.NavigateUrl = string.Format("openReportWindNotHeader('reportcode', 'QuanLyHoaDon_NotHeaderMutil', {0}, 2, 0);", gridContainer.KeyValue); //link.Text = string.Format("Get details about device {0}", gridContainer.KeyValue); link.ImageUrl = "~/img/btnico/gnome_printer.png"; link.Width = Unit.Pixel(200); link.ID = gridContainer.KeyValue.ToString(); // link.ClientInstanceName = string.Format("printA4{0}", gridContainer.KeyValue); container.Controls.Add(link); }
public void InstantiateIn(Control container) { ASPxHyperLink link = new ASPxHyperLink(); GridViewDataItemTemplateContainer gridContainer = (GridViewDataItemTemplateContainer)container; link.ImageUrl = "~/img/btnico/gnome_printer.png"; link.Width = Unit.Pixel(200); link.ID = gridContainer.KeyValue.ToString(); container.Controls.Add(link); }
protected void lnkDelete_Load(object sender, EventArgs e) { ASPxHyperLink lnk = sender as ASPxHyperLink; lnk.ClientEnabled = !chkDelete.Checked; }
private WebControl CreateHyperLinknavigateUrlRelate(Control container) { HttpContext.Current.Session["moduleidrl"] = _moduleID; ASPxHyperLink hyperlink = new ASPxHyperLink(); templateContainer = (GridViewDataItemTemplateContainer)container; hyperlink.ID = (templateContainer.Column).Name; hyperlink.ClientInstanceName = (templateContainer.Column).Name; //Lấy ta danh sách các thuộc tính liên quan DataTable dtPropertiesField = ObjectUtils.getField4HyperlinkInfo(_moduleID, hyperlink.ID, CU.getBOID()); if (dtPropertiesField.Rows.Count > 0) { if ((templateContainer.Column).FieldName != string.Empty) { string navURL = dtPropertiesField.Rows[0]["navigateUrlRelate"].ToString(); // string fieldname = dtPropertiesField.Rows[0]["fieldname"].ToString(); if (navURL != "") { string hyperlinkText = templateContainer.Grid.GetRowValues(templateContainer.VisibleIndex, (templateContainer.Column).FieldName).ToString(); hyperlink.Text = hyperlinkText; string keyrowclick = templateContainer.KeyValue.ToString(); HttpContext.Current.Session["keyrowclickrl"] = keyrowclick; string sql = "SELECT " + _keytablename.ToString() + " FROM " + _objectnamefk + " WHERE " + _keyFieldName.ToString() + "='" + keyrowclick + "'"; _keyhyperlinkclick = SqlHelper.ExecuteScalar( DataServices.ConnectString, CommandType.Text, sql).ToString(); HttpContext.Current.Session["keyhyperlinkclickrl"] = _keyhyperlinkclick; navURL = GetNavigateUrl(navURL); //navURL = dtPropertiesField.Rows[0]["navigateUrl"].ToString() + templateContainer.KeyValue.ToString() + "&m=" + _moduleID+"table==="+_tableName; string ClientSEClick = "function(s,e){ js:openWindow('" + navURL + "');}"; //hyperlink.NavigateUrl = aaa; hyperlink.ClientSideEvents.Click = ClientSEClick; } } } return hyperlink; }
protected void ChangePW_Init(object sender, EventArgs e) { ASPxHyperLink link = sender as ASPxHyperLink; link.NavigateUrl = "change_password.aspx"; }
private WebControl CreateHyperLinkButton(Control container) { ASPxHyperLink hyperlink = new ASPxHyperLink(); templateContainer = (GridViewDataItemTemplateContainer)container; hyperlink.ID = string.Format("{0}_{1}", (templateContainer.Column).FieldName, templateContainer.VisibleIndex); hyperlink.ClientInstanceName = string.Format("{0}_{1}", (templateContainer.Column).FieldName, templateContainer.VisibleIndex); //Lấy ta danh sách các thuộc tính liên quan DataSet listproperty = SqlHelper.ExecuteDataset( DataServices.ConnectString, "sp_core_modulefields_GetpropertyTypeHyperlink", _moduleID, _tableName, (templateContainer.Column).FieldName); DataTable dtPropertiesField = listproperty.Tables[0]; if (dtPropertiesField.Rows.Count > 0) { string navURL = dtPropertiesField.Rows[0]["navigateUrl"].ToString(); if (navURL != "") { hyperlink.ClientSideEvents.Click = "function(s,e){openMiniWindow('~/Modules/Master/PopupCRUDHyper.aspx?module=" + _moduleID + "&field=" + (templateContainer.Column).FieldName + "&id=" + templateContainer.KeyValue.ToString() + "', 1025, 590);}"; hyperlink.ImageUrl = dtPropertiesField.Rows[0]["imageUrl"].ToString(); hyperlink.ImageWidth = Unit.Pixel(16); hyperlink.ImageHeight = Unit.Pixel(16); } } return hyperlink; }
protected void hyperLink_Init(object sender, EventArgs e) { System.Drawing.Color showcolor = Color.Transparent; bool isEnableLink = false; ASPxHyperLink link = (ASPxHyperLink)sender; GridViewDataItemTemplateContainer templateContainer = (GridViewDataItemTemplateContainer)link.NamingContainer; int rowVisibleIndex = templateContainer.VisibleIndex; string status = templateContainer.Grid.GetRowValues(rowVisibleIndex, templateContainer.Column.FieldName).ToString(); string partyid = templateContainer.Grid.GetRowValues(rowVisibleIndex, "PARTY_ID").ToString(); string fieldSelect = templateContainer.Column.FieldName.Substring(0, 2); string etd_date = templateContainer.Grid.GetRowValues(rowVisibleIndex, fieldSelect + "_ETD_DATE").ToString(); string etd_time = templateContainer.Grid.GetRowValues(rowVisibleIndex, fieldSelect + "_ETD_TIME").ToString(); string etd = etd_date + " " + etd_time; string wh = templateContainer.Grid.GetRowValues(rowVisibleIndex, "WH_ID").ToString(); switch (status.ToString().ToLower()) { case "complete": showcolor = System.Drawing.Color.SkyBlue; isEnableLink = true; break; case "pick-load": //showcolor = System.Drawing.Color.Green; showcolor = System.Drawing.ColorTranslator.FromHtml("#0FAB0F"); isEnableLink = true; break; case "not compt": showcolor = System.Drawing.Color.Yellow; isEnableLink = true; break; case "delay": showcolor = System.Drawing.Color.Red; isEnableLink = true; break; case "no plan": showcolor = System.Drawing.Color.White; isEnableLink = false; break; default: showcolor = System.Drawing.Color.White; isEnableLink = false; break; } //link.NavigateUrl = "javascript:void(0);"; string detailUrl = Request.Url.GetLeftPart(UriPartial.Authority) + VirtualPathUtility.ToAbsolute("~/") + string.Format("frmDeliveryDTL.aspx?strPARTY_ID={0}&strETD={1}&strWH_ID={2}&strSTATUS={3}", partyid, etd, wh, status); //string url = string.Format("~//frmDeliveryDTL.aspx?strPARTY_ID={0}&strETD={1}&strWH_ID={2}&strSTATUS={3}", partyid, etd, wh, status); link.NavigateUrl = detailUrl;//"~/frmDeliveryDTL.aspx"; link.Text = status; link.ForeColor = showcolor; link.Font.Size = 13; link.Font.Bold = true; link.Enabled = isEnableLink; //link.ClientSideEvents.Click = string.Format("function(s, e) {{ ShowDetailPopup('{0}', '{1}', '{2} {3}'); }}", status, partyid, etd_date, etd_time); }
protected void ASPxHyperLinkDemo_Init(object sender, EventArgs e) { ASPxHyperLink hyperLink = (ASPxHyperLink)sender; hyperLink.ClientSideEvents.Click = string.Format("function(s, e) {{ ShowHidePopUpControl({0}); }}", ASPxPopupControlDemo.ClientID); }
ASPxHyperLink CreateHyperLink() { ASPxHyperLink hyperlink = RenderHelper.CreateASPxHyperLink(); return(hyperlink); }
public void buildPCAtable() { int nvars = _numvars.Count; if (_pca == null || _final_N == 0) { ASPxLabel label = new ASPxLabel(); label.Text = string.Format("PCA analysis, listwise deletion N = {0} {1}", _final_N, _subtitle); label.Font.Bold = true; ASPxLabel labela = new ASPxLabel(); Table t = new Table(); TableRow r1 = new TableRow(); TableCell c1 = new TableCell(); c1.Controls.Add(label); OutputTable = t; } else { DataTable dt_pca = new DataTable(); dt_pca.Columns.Add("index", typeof(int)); dt_pca.Columns.Add("eigenvalue", typeof(double)); dt_pca.Columns.Add("proportion_of_variance", typeof(double)); dt_pca.Columns.Add("cum_proportion_of_variance", typeof(double)); foreach (Accord.Statistics.Analysis.PrincipalComponent comp in _pca.Components) { DataRow row = dt_pca.NewRow(); row["index"] = comp.Index + 1; row["eigenvalue"] = Math.Round(comp.Eigenvalue, 4); row["proportion_of_variance"] = Math.Round(comp.Proportion, 4); row["cum_proportion_of_variance"] = Math.Round(comp.CumulativeProportion, 4); dt_pca.Rows.Add(row); } ASPxGridView gv = new ASPxGridView(); gv.DataSource = dt_pca; gv.DataBind(); DataTable dt_compmatrix = new DataTable(); dt_compmatrix.Columns.Add("varname", typeof(string)); for (int n = 0; n < nvars; n++) { dt_compmatrix.Columns.Add(String.Format("PC{0}", n + 1), typeof(double)); } for (int i = 0; i < nvars; i++) { DataRow row = dt_compmatrix.NewRow(); row[0] = _numvars[i]; for (int j = 0; j < _numvars.Count; j++) { row[j + 1] = Math.Round(_pca.ComponentMatrix[i, j] * _pca.SingularValues[j], 4); } dt_compmatrix.Rows.Add(row); } ASPxGridView gv2 = new ASPxGridView(); gv2.DataSource = dt_compmatrix; gv2.DataBind(); #region build table string lbl1 = string.Format("PCA analysis, listwise deletion N = {0} {1}", _final_N, _subtitle); string lbl1a = string.Format("{0}Method: {1}", Environment.NewLine, _method); string lbl2 = string.Format("{0}Factor loadings", Environment.NewLine);; ASPxLabel label = new ASPxLabel(); label.Text = lbl1; label.Font.Bold = true; ASPxLabel labela = new ASPxLabel(); labela.Text = lbl1a; labela.Font.Bold = true; ASPxLabel label2 = new ASPxLabel(); label2.Text = lbl2; label2.Font.Bold = true; OutputGridviews = new List <OutputGridview>(); OutputMainTitle = lbl1; OutputGridviews.Add(new OutputGridview() { Title = lbl1a, Grid = gv }); OutputGridviews.Add(new OutputGridview() { Title = lbl2, Grid = gv2 }); Table t = new Table(); TableRow r1 = new TableRow(); TableCell c1 = new TableCell(); c1.Controls.Add(label); c1.Controls.Add(labela); c1.Controls.Add(gv); TableCell c2 = new TableCell(); c2.Controls.Add(label2); c2.Controls.Add(gv2); c1.Width = 550; r1.Cells.Add(c1); r1.Cells.Add(c2); t.Rows.Add(r1); TableRow r2 = new TableRow(); TableCell c21 = new TableCell(); ASPxHyperLink hyp1 = new ASPxHyperLink() { NavigateUrl = "http://accord-framework.net/docs/html/T_Accord_Statistics_Analysis_PrincipalComponentAnalysis.htm", Text = "Conducted with Accord.NET Framework v3.8.0 (with whiten=true)" }; ASPxLabel l21 = new ASPxLabel(); l21.Text = string.Format(" and results with test data match those obtained using the "); ASPxHyperLink hyp2 = new ASPxHyperLink() { NavigateUrl = "http://stat.ethz.ch/R-manual/R-devel/library/stats/html/prcomp.html", Text = "R 'prcomp' package." }; Literal l22 = new Literal(); l22.Text = "<br/>However, users should replicate these results on their own before publication!"; c21.ColumnSpan = 2; c21.Controls.Add(hyp1); c21.Controls.Add(l21); c21.Controls.Add(hyp2); c21.Controls.Add(l22); r2.Cells.Add(c21); t.Rows.Add(r2); TableRow r3 = new TableRow(); TableCell c31 = new TableCell() { ColumnSpan = 2 }; ASPxHyperLink hyp3 = new ASPxHyperLink() { NavigateUrl = "https://arxiv.org/ftp/arxiv/papers/1210/1210.7463.pdf", Text = "Link to Accord.NET PCA tutorial." }; c31.Controls.Add(hyp3); r3.Cells.Add(c31); t.Rows.Add(r3); #endregion OutputTable = t; } }