private void Page_Load(object sender, System.EventArgs e) { //Put user code to initialize the page here System.Web.UI.HtmlControls.HtmlForm frm = (HtmlForm)this.FindControl("Form1"); GHTTestBegin(frm); GHTActiveSubTest = GHTSubTest1; try { DataGrid1.DataSource = GHTTests.GHDataSources.DSDataTable(0, 1, "http://"); System.Web.UI.WebControls.HyperLinkColumn c_id = new System.Web.UI.WebControls.HyperLinkColumn(); System.Web.UI.WebControls.HyperLinkColumn c_name = new System.Web.UI.WebControls.HyperLinkColumn(); System.Web.UI.WebControls.HyperLinkColumn c_company = new System.Web.UI.WebControls.HyperLinkColumn(); c_id.DataTextField = "ID"; c_id.NavigateUrl = "http://www.google.com"; c_name.DataTextField = "Name"; c_name.DataNavigateUrlField = "Name"; c_company.DataTextField = "Company"; c_company.DataNavigateUrlField = "Company"; DataGrid1.Columns.Add(c_id); DataGrid1.Columns.Add(c_name); DataGrid1.Columns.Add(c_company); DataGrid1.DataBind();; } catch (Exception ex) { GHTSubTestUnexpectedExceptionCaught(ex); } GHTTestEnd(); }
private void Page_Load(object sender, System.EventArgs e) { //Put user code to initialize the page here System.Web.UI.HtmlControls.HtmlForm frm = (HtmlForm)this.FindControl("Form1"); GHTTestBegin(frm); GHTActiveSubTest = GHTSubTest1; try { DataGrid1.DataSource = GHTTests.GHDataSources.DSDataTable(); System.Web.UI.WebControls.HyperLinkColumn c_id = new System.Web.UI.WebControls.HyperLinkColumn(); System.Web.UI.WebControls.HyperLinkColumn c_name = new System.Web.UI.WebControls.HyperLinkColumn(); System.Web.UI.WebControls.HyperLinkColumn c_company = new System.Web.UI.WebControls.HyperLinkColumn(); c_id.DataTextField = "ID"; c_id.NavigateUrl = "http://www.example.com"; c_id.Target = ""; c_name.DataTextField = "Name"; c_name.NavigateUrl = "http://www.example.com"; c_name.Target = "_blank"; c_company.DataTextField = "Company"; c_company.NavigateUrl = "http://www.example.com"; c_company.Target = "skjfh skjf hkjd"; DataGrid1.Columns.Add(c_id); DataGrid1.Columns.Add(c_name); DataGrid1.Columns.Add(c_company); DataGrid1.DataBind();; GHTSubTestAddResult(c_id.Target); GHTSubTestAddResult(c_name.Target); GHTSubTestAddResult(c_company.Target); } catch (Exception ex) { GHTSubTestUnexpectedExceptionCaught(ex); } GHTActiveSubTest = Ghtsubtest2; try { DataGrid2.DataSource = GHTTests.GHDataSources.DSDataTable(); DataGrid2.DataBind();; GHTSubTestAddResult(((System.Web.UI.WebControls.HyperLinkColumn)DataGrid2.Columns[0]).NavigateUrl); GHTSubTestAddResult(((System.Web.UI.WebControls.HyperLinkColumn)DataGrid2.Columns[1]).NavigateUrl); GHTSubTestAddResult(((System.Web.UI.WebControls.HyperLinkColumn)DataGrid2.Columns[2]).NavigateUrl); } catch (Exception ex) { GHTSubTestUnexpectedExceptionCaught(ex); } GHTTestEnd(); }
public void SetUpTest () { HyperLinkColumn column = new HyperLinkColumn (); Assert.AreEqual (String.Empty, column.DataNavigateUrlField, "#1"); Assert.AreEqual (String.Empty, column.DataTextField, "2"); Assert.AreEqual (String.Empty, column.DataTextFormatString, "#3"); Assert.AreEqual (String.Empty, column.NavigateUrl, "#4"); Assert.AreEqual (String.Empty, column.Target, "#5"); Assert.AreEqual (String.Empty, column.Text, "#6"); }
private void Page_Load(object sender, System.EventArgs e) { //Put user code to initialize the page here System.Web.UI.HtmlControls.HtmlForm frm = (HtmlForm)this.FindControl("Form1"); GHTTestBegin(frm); GHTActiveSubTest = GHTSubTest1; try { DataGrid1.DataSource = GHTTests.GHDataSources.DSDataTable(); System.Web.UI.WebControls.HyperLinkColumn c_id = new System.Web.UI.WebControls.HyperLinkColumn(); System.Web.UI.WebControls.HyperLinkColumn c_name = new System.Web.UI.WebControls.HyperLinkColumn(); System.Web.UI.WebControls.HyperLinkColumn c_company = new System.Web.UI.WebControls.HyperLinkColumn(); c_id.DataTextField = "ID"; c_id.NavigateUrl = ""; c_name.DataTextField = "Name"; c_name.NavigateUrl = "http://localhost/asdjkaffd/asdkjhkgss/.sdfkjhsdkf/f/f/f/f/fsdfkjh///skjdk"; c_company.DataTextField = "Company"; c_company.NavigateUrl = "123.123.123.123/sdkh/........./sjhfg"; DataGrid1.Columns.Add(c_id); DataGrid1.Columns.Add(c_name); DataGrid1.Columns.Add(c_company); DataGrid1.DataBind();; GHTSubTestAddResult(c_id.NavigateUrl); GHTSubTestAddResult(c_name.NavigateUrl); GHTSubTestAddResult(c_company.NavigateUrl); } catch (Exception ex) { GHTSubTestUnexpectedExceptionCaught(ex); } GHTActiveSubTest = Ghtsubtest2; try { DataGrid2.DataSource = GHTTests.GHDataSources.DSDataTable(); DataGrid2.DataBind();; GHTSubTestAddResult(( (System.Web.UI.WebControls.HyperLinkColumn)DataGrid2.Columns[0]).NavigateUrl); GHTSubTestAddResult(( (System.Web.UI.WebControls.HyperLinkColumn)DataGrid2.Columns[1]).NavigateUrl); GHTSubTestAddResult(( (System.Web.UI.WebControls.HyperLinkColumn)DataGrid2.Columns[2]).NavigateUrl); } catch (Exception ex) { GHTSubTestUnexpectedExceptionCaught(ex); } GHTTestEnd(); }
private void Page_Load(object sender, System.EventArgs e) { //Put user code to initialize the page here System.Web.UI.HtmlControls.HtmlForm frm = (HtmlForm)this.FindControl("Form1"); GHTTestBegin(frm); GHTActiveSubTest = GHTSubTest1; try { DataGrid1.DataSource = GHTTests.GHDataSources.DSDataTable(); System.Web.UI.WebControls.HyperLinkColumn c_id = new System.Web.UI.WebControls.HyperLinkColumn(); System.Web.UI.WebControls.HyperLinkColumn c_name = new System.Web.UI.WebControls.HyperLinkColumn(); System.Web.UI.WebControls.HyperLinkColumn c_company = new System.Web.UI.WebControls.HyperLinkColumn(); c_id.DataTextField = "ID"; c_id.NavigateUrl = ""; c_name.DataTextField = "Name"; c_name.NavigateUrl = "http://localhost/asdjkaffd/asdkjhkgss/.sdfkjhsdkf/f/f/f/f/fsdfkjh///skjdk"; c_company.DataTextField = "Company"; c_company.NavigateUrl = "123.123.123.123/sdkh/........./sjhfg"; DataGrid1.Columns.Add(c_id); DataGrid1.Columns.Add(c_name); DataGrid1.Columns.Add(c_company); DataGrid1.DataBind();; GHTSubTestAddResult(c_id.NavigateUrl); GHTSubTestAddResult(c_name.NavigateUrl); GHTSubTestAddResult(c_company.NavigateUrl); } catch (Exception ex) { GHTSubTestUnexpectedExceptionCaught(ex); } GHTActiveSubTest = Ghtsubtest2; try { DataGrid2.DataSource = GHTTests.GHDataSources.DSDataTable(); DataGrid2.DataBind();; GHTSubTestAddResult(((System.Web.UI.WebControls.HyperLinkColumn)DataGrid2.Columns[0]).NavigateUrl); GHTSubTestAddResult(((System.Web.UI.WebControls.HyperLinkColumn)DataGrid2.Columns[1]).NavigateUrl); GHTSubTestAddResult(((System.Web.UI.WebControls.HyperLinkColumn)DataGrid2.Columns[2]).NavigateUrl); } catch (Exception ex) { GHTSubTestUnexpectedExceptionCaught(ex); } GHTTestEnd(); }
private void Page_Load(object sender, System.EventArgs e) { //Put user code to initialize the page here System.Web.UI.HtmlControls.HtmlForm frm = (HtmlForm)this.FindControl("Form1"); GHTTestBegin(frm); GHTActiveSubTest = GHTSubTest1; try { DataGrid1.DataSource = GHTTests.GHDataSources.DSDataTable(0, 1, "http://"); System.Web.UI.WebControls.HyperLinkColumn c_id = new System.Web.UI.WebControls.HyperLinkColumn(); System.Web.UI.WebControls.HyperLinkColumn c_name = new System.Web.UI.WebControls.HyperLinkColumn(); System.Web.UI.WebControls.HyperLinkColumn c_company = new System.Web.UI.WebControls.HyperLinkColumn(); c_id.Text = ""; c_id.DataNavigateUrlField = "Name"; c_name.Text = "simple text"; c_name.DataNavigateUrlField = "Name"; c_company.Text = "text with !@#$%^&*()_+"; c_company.DataNavigateUrlField = "Name"; DataGrid1.Columns.Add(c_id); DataGrid1.Columns.Add(c_name); DataGrid1.Columns.Add(c_company); DataGrid1.DataBind();; GHTSubTestAddResult(c_id.Text); GHTSubTestAddResult(c_name.Text); GHTSubTestAddResult(c_company.Text); } catch (Exception ex) { GHTSubTestUnexpectedExceptionCaught(ex); } GHTActiveSubTest = Ghtsubtest2; try { DataGrid2.DataSource = GHTTests.GHDataSources.DSDataTable(0, 1, "http://"); DataGrid2.DataBind();; GHTSubTestAddResult(((System.Web.UI.WebControls.HyperLinkColumn)DataGrid2.Columns[0]).Text); GHTSubTestAddResult(((System.Web.UI.WebControls.HyperLinkColumn)DataGrid2.Columns[1]).Text); GHTSubTestAddResult(((System.Web.UI.WebControls.HyperLinkColumn)DataGrid2.Columns[2]).Text); } catch (Exception ex) { GHTSubTestUnexpectedExceptionCaught(ex); } GHTTestEnd(); }
private void Page_Load(object sender, System.EventArgs e) { //Put user code to initialize the page here System.Web.UI.HtmlControls.HtmlForm frm = (HtmlForm)this.FindControl("Form1"); GHTTestBegin(frm); GHTActiveSubTest = GHTSubTest1; try { DataGrid1.DataSource = GHTTests.GHDataSources.DSDataTable(0, 1, "http://"); System.Web.UI.WebControls.HyperLinkColumn c_id = new System.Web.UI.WebControls.HyperLinkColumn(); System.Web.UI.WebControls.HyperLinkColumn c_name = new System.Web.UI.WebControls.HyperLinkColumn(); System.Web.UI.WebControls.HyperLinkColumn c_company = new System.Web.UI.WebControls.HyperLinkColumn(); c_id.Text = ""; c_id.DataNavigateUrlField = "Name"; c_name.Text = "simple text"; c_name.DataNavigateUrlField = "Name"; c_company.Text = "text with !@#$%^&*()_+"; c_company.DataNavigateUrlField = "Name"; DataGrid1.Columns.Add(c_id); DataGrid1.Columns.Add(c_name); DataGrid1.Columns.Add(c_company); DataGrid1.DataBind();; GHTSubTestAddResult(c_id.Text); GHTSubTestAddResult(c_name.Text); GHTSubTestAddResult(c_company.Text); } catch (Exception ex) { GHTSubTestUnexpectedExceptionCaught(ex); } GHTActiveSubTest = Ghtsubtest2; try { DataGrid2.DataSource = GHTTests.GHDataSources.DSDataTable(0, 1, "http://"); DataGrid2.DataBind();; GHTSubTestAddResult(( (System.Web.UI.WebControls.HyperLinkColumn)DataGrid2.Columns[0]).Text); GHTSubTestAddResult(( (System.Web.UI.WebControls.HyperLinkColumn)DataGrid2.Columns[1]).Text); GHTSubTestAddResult(( (System.Web.UI.WebControls.HyperLinkColumn)DataGrid2.Columns[2]).Text); } catch (Exception ex) { GHTSubTestUnexpectedExceptionCaught(ex); } GHTTestEnd(); }
public void DataNavigateUrlFieldTest () { HyperLinkColumn column = new HyperLinkColumn (); string foo = "foo"; string bar = "bar"; column.NavigateUrl = foo; Assert.AreEqual (foo, column.NavigateUrl, "#1"); // Test the bit about DataNavigateUrlField having precedence over NavigateUrl column.DataNavigateUrlField = bar; Assert.AreEqual (bar, column.DataNavigateUrlField, "#2"); // what does this mean? shouldn't NavigateUrl be "bar" now? Assert.AreEqual (foo, column.NavigateUrl, "#3"); }
private DataGridColumn c_hyper_link(string se) { HyperLinkColumn column1 = new HyperLinkColumn(); column1.DataTextField = "ID"; column1.NavigateUrl = "http://www.google.com"; column1.SortExpression = se; return column1; }
private void Page_Load(object sender, System.EventArgs e) { //Put user code to initialize the page here System.Web.UI.HtmlControls.HtmlForm frm = (HtmlForm)this.FindControl("Form1"); GHTTestBegin(frm); GHTActiveSubTest = GHTSubTest1; try { DataGrid1.DataSource = GHTTests.GHDataSources.DSDataTable(); System.Web.UI.WebControls.HyperLinkColumn c_id = new System.Web.UI.WebControls.HyperLinkColumn(); System.Web.UI.WebControls.HyperLinkColumn c_name = new System.Web.UI.WebControls.HyperLinkColumn(); System.Web.UI.WebControls.HyperLinkColumn c_company = new System.Web.UI.WebControls.HyperLinkColumn(); c_id.DataNavigateUrlField = ""; c_id.DataNavigateUrlFormatString = ""; c_id.Text = "123"; c_name.DataNavigateUrlField = "Name"; c_name.DataNavigateUrlFormatString = "(format str)"; c_name.Text = "123"; c_company.DataNavigateUrlField = "Company"; c_company.DataNavigateUrlFormatString = "{0:c5}"; c_company.Text = "123"; DataGrid1.Columns.Add(c_id); DataGrid1.Columns.Add(c_name); DataGrid1.Columns.Add(c_company); DataGrid1.DataBind();; GHTSubTestAddResult(c_id.DataNavigateUrlFormatString); GHTSubTestAddResult(c_name.DataNavigateUrlFormatString); GHTSubTestAddResult(c_company.DataNavigateUrlFormatString); } catch (Exception ex) { GHTSubTestUnexpectedExceptionCaught(ex); } GHTActiveSubTest = Ghtsubtest2; try { DataGrid2.DataSource = GHTTests.GHDataSources.DSDataTable(); System.Web.UI.WebControls.HyperLinkColumn c_id = new System.Web.UI.WebControls.HyperLinkColumn(); c_id.DataNavigateUrlField = "ID"; c_id.DataNavigateUrlFormatString = "{0:c5}"; c_id.Text = "123"; DataGrid2.Columns.Add(c_id); DataGrid2.DataBind();; GHTSubTestAddResult(c_id.DataNavigateUrlFormatString); } catch (Exception ex) { GHTSubTestUnexpectedExceptionCaught(ex); } GHTActiveSubTest = Ghtsubtest3; try { DataGrid3.DataSource = GHTTests.GHDataSources.DSDataTable(); DataGrid3.DataBind();; GHTSubTestAddResult(((System.Web.UI.WebControls.HyperLinkColumn)DataGrid3.Columns[0]).DataNavigateUrlFormatString); GHTSubTestAddResult(((System.Web.UI.WebControls.HyperLinkColumn)DataGrid3.Columns[1]).DataNavigateUrlFormatString); GHTSubTestAddResult(((System.Web.UI.WebControls.HyperLinkColumn)DataGrid3.Columns[2]).DataNavigateUrlFormatString); } catch (Exception ex) { GHTSubTestUnexpectedExceptionCaught(ex); } GHTActiveSubTest = Ghtsubtest4; try { DataGrid4.DataSource = GHTTests.GHDataSources.DSDataTable(); DataGrid4.DataBind();; GHTSubTestAddResult(((System.Web.UI.WebControls.HyperLinkColumn)DataGrid4.Columns[0]).DataNavigateUrlFormatString); GHTSubTestAddResult(((System.Web.UI.WebControls.HyperLinkColumn)DataGrid4.Columns[1]).DataNavigateUrlFormatString); GHTSubTestAddResult(((System.Web.UI.WebControls.HyperLinkColumn)DataGrid4.Columns[2]).DataNavigateUrlFormatString); } catch (Exception ex) { GHTSubTestUnexpectedExceptionCaught(ex); } GHTTestEnd(); }
// 02/08/2008 We need to build a list of the fields used by the dynamic grid. // 03/01/2014 Add Preview button. public static void AppendGridColumns(string sGRID_NAME, DataGrid grd, UniqueStringCollection arrSelectFields, CommandEventHandler Page_Command) { if ( grd == null ) { SplendidError.SystemWarning(new StackTrace(true).GetFrame(0), "DataGrid is not defined for " + sGRID_NAME); return; } DataTable dt = SplendidCache.GridViewColumns(sGRID_NAME); if ( dt != null ) { // 01/01/2008 Pull config flag outside the loop. bool bEnableTeamManagement = Crm.Config.enable_team_management(); // 08/28/2009 Allow dynamic teams to be turned off. bool bEnableDynamicTeams = Crm.Config.enable_dynamic_teams(); foreach(DataRow row in dt.Rows) { int nCOLUMN_INDEX = Sql.ToInteger(row["COLUMN_INDEX" ]); string sCOLUMN_TYPE = Sql.ToString (row["COLUMN_TYPE" ]); string sHEADER_TEXT = Sql.ToString (row["HEADER_TEXT" ]); string sSORT_EXPRESSION = Sql.ToString (row["SORT_EXPRESSION" ]); string sITEMSTYLE_WIDTH = Sql.ToString (row["ITEMSTYLE_WIDTH" ]); string sITEMSTYLE_CSSCLASS = Sql.ToString (row["ITEMSTYLE_CSSCLASS" ]); string sITEMSTYLE_HORIZONTAL_ALIGN = Sql.ToString (row["ITEMSTYLE_HORIZONTAL_ALIGN"]); string sITEMSTYLE_VERTICAL_ALIGN = Sql.ToString (row["ITEMSTYLE_VERTICAL_ALIGN" ]); bool bITEMSTYLE_WRAP = Sql.ToBoolean(row["ITEMSTYLE_WRAP" ]); string sDATA_FIELD = Sql.ToString (row["DATA_FIELD" ]); string sDATA_FORMAT = Sql.ToString (row["DATA_FORMAT" ]); string sURL_FIELD = Sql.ToString (row["URL_FIELD" ]); string sURL_FORMAT = Sql.ToString (row["URL_FORMAT" ]); string sURL_TARGET = Sql.ToString (row["URL_TARGET" ]); string sLIST_NAME = Sql.ToString (row["LIST_NAME" ]); // 04/28/2006 The module is necessary in order to determine if a user has access. string sURL_MODULE = Sql.ToString (row["URL_MODULE" ]); // 05/02/2006 The assigned user id is necessary if the user only has Owner access. string sURL_ASSIGNED_FIELD = Sql.ToString (row["URL_ASSIGNED_FIELD" ]); // 02/16/2010 Add MODULE_TYPE so that we can lookup custom field IDs. string sMODULE_TYPE = String.Empty; try { sMODULE_TYPE = Sql.ToString (row["MODULE_TYPE"]); } catch(Exception ex) { // 06/16/2010 The MODULE_TYPE is not in the view, then log the error and continue. SplendidError.SystemWarning(new StackTrace(true).GetFrame(0), ex); } // 10/09/2010 Add PARENT_FIELD so that we can establish dependent listboxes. string sPARENT_FIELD = String.Empty; try { sPARENT_FIELD = Sql.ToString (row["PARENT_FIELD"]); } catch(Exception ex) { // 10/09/2010 The PARENT_FIELD is not in the view, then log the error and continue. SplendidError.SystemWarning(new StackTrace(true).GetFrame(0), ex); } if ( (sDATA_FIELD == "TEAM_NAME" || sDATA_FIELD == "TEAM_SET_NAME") ) { if ( bEnableTeamManagement && bEnableDynamicTeams ) { sHEADER_TEXT = ".LBL_LIST_TEAM_SET_NAME"; sDATA_FIELD = "TEAM_SET_NAME"; } } // 02/08/2008 We need to build a list of the fields used by the dynamic grid. if ( arrSelectFields != null ) { // 08/02/2010 The JavaScript and Hover fields will not have a data field. if ( !Sql.IsEmptyString(sDATA_FIELD) ) arrSelectFields.Add(sDATA_FIELD); if ( !Sql.IsEmptyString(sSORT_EXPRESSION) ) arrSelectFields.Add(sSORT_EXPRESSION); if ( !Sql.IsEmptyString(sURL_FIELD) ) { // 08/02/2010 We want to allow Terminology fields, so exclude anything with a "." if ( sURL_FIELD.IndexOf(' ') >= 0 ) { string[] arrURL_FIELD = sURL_FIELD.Split(' '); foreach ( string s in arrURL_FIELD ) { if ( !s.Contains(".") && !Sql.IsEmptyString(s) ) arrSelectFields.Add(s); } } else if ( !sURL_FIELD.Contains(".") ) arrSelectFields.Add(sURL_FIELD); if ( !Sql.IsEmptyString(sURL_ASSIGNED_FIELD) ) arrSelectFields.Add(sURL_ASSIGNED_FIELD); } // 10/09/2010 Add PARENT_FIELD so that we can establish dependent listboxes. if ( !Sql.IsEmptyString(sPARENT_FIELD) ) arrSelectFields.Add(sPARENT_FIELD); } HorizontalAlign eHorizontalAlign = HorizontalAlign.NotSet; switch ( sITEMSTYLE_HORIZONTAL_ALIGN.ToLower() ) { case "left" : eHorizontalAlign = HorizontalAlign.Left ; break; case "right": eHorizontalAlign = HorizontalAlign.Right; break; } VerticalAlign eVerticalAlign = VerticalAlign.NotSet; switch ( sITEMSTYLE_VERTICAL_ALIGN.ToLower() ) { case "top" : eVerticalAlign = VerticalAlign.Top ; break; case "middle": eVerticalAlign = VerticalAlign.Middle; break; case "bottom": eVerticalAlign = VerticalAlign.Bottom; break; } // 11/28/2005 Wrap defaults to true. if ( row["ITEMSTYLE_WRAP"] == DBNull.Value ) bITEMSTYLE_WRAP = true; // 01/18/2010 To apply ACL Field Security, we need to know if the Module Name, which we will extract from the EditView Name. string sMODULE_NAME = String.Empty; string[] arrGRID_NAME = sGRID_NAME.Split('.'); if ( arrGRID_NAME.Length > 0 ) { if ( arrGRID_NAME[0] == "ListView" || arrGRID_NAME[0] == "PopupView" || arrGRID_NAME[0] == "Activities" ) sMODULE_NAME = arrGRID_NAME[0]; // 01/18/2010 A sub-panel should apply the access rules of the related module. else if ( Sql.ToBoolean(HttpContext.Current.Application["Modules." + arrGRID_NAME[1] + ".Valid"]) ) sMODULE_NAME = arrGRID_NAME[1]; else sMODULE_NAME = arrGRID_NAME[0]; } // 01/18/2010 A field is either visible or not. At this time, we will not only show a field to its owner. bool bIsReadable = true; // 08/02/2010 The JavaScript and Hover fields will not have a data field. if ( SplendidInit.bEnableACLFieldSecurity && !Sql.IsEmptyString(sDATA_FIELD) ) { Security.ACL_FIELD_ACCESS acl = Security.GetUserFieldSecurity(sMODULE_NAME, sDATA_FIELD, Guid.Empty); bIsReadable = acl.IsReadable(); } DataGridColumn col = null; // 02/03/2006 Date and Currency must always be handled by CreateItemTemplateLiteral. // Otherwise, the date or time will not get properly translated to the correct timezone. // This bug was reported by David Williams. // 05/20/2009 We need a way to preserve CRLF in description fields. if ( String.Compare(sCOLUMN_TYPE, "BoundColumn", true) == 0 && ( String.Compare(sDATA_FORMAT, "Date" , true) == 0 || String.Compare(sDATA_FORMAT, "DateTime" , true) == 0 || String.Compare(sDATA_FORMAT, "Currency" , true) == 0 || String.Compare(sDATA_FORMAT, "Image" , true) == 0 || String.Compare(sDATA_FORMAT, "MultiLine" , true) == 0 ) ) { sCOLUMN_TYPE = "TemplateColumn"; } // 03/14/2014 A hidden field does not render. It is primarily used to add a field to the SQL select list for Business Rules management. else if ( String.Compare(sCOLUMN_TYPE, "Hidden", true) == 0 ) { continue; } if ( String.Compare(sCOLUMN_TYPE, "BoundColumn", true) == 0 ) { if ( Sql.IsEmptyString(sLIST_NAME) ) { // GRID_NAME, COLUMN_ORDER, COLUMN_TYPE, HEADER_TEXT, DATA_FIELD, SORT_EXPRESSION, ITEMSTYLE_WIDTH BoundColumn bnd = new BoundColumn(); bnd.HeaderText = sHEADER_TEXT ; bnd.DataField = sDATA_FIELD ; bnd.SortExpression = sSORT_EXPRESSION ; bnd.ItemStyle.Width = new Unit(sITEMSTYLE_WIDTH); bnd.ItemStyle.CssClass = sITEMSTYLE_CSSCLASS; bnd.ItemStyle.HorizontalAlign = eHorizontalAlign ; bnd.ItemStyle.VerticalAlign = eVerticalAlign ; bnd.ItemStyle.Wrap = bITEMSTYLE_WRAP ; // 04/13/2007 Align the headers to match the data. bnd.HeaderStyle.HorizontalAlign = eHorizontalAlign ; col = bnd; // 01/18/2010 Apply ACL Field Security. col.Visible = bIsReadable; // 10/23/2012 Kevin. Allow me to pass data format for gridview bound columns. if ( !Sql.IsEmptyString(sDATA_FORMAT) ) { bnd.DataFormatString = sDATA_FORMAT; } } else { // GRID_NAME, COLUMN_ORDER, COLUMN_TYPE, HEADER_TEXT, DATA_FIELD, SORT_EXPRESSION, ITEMSTYLE_WIDTH TemplateColumn tpl = new TemplateColumn(); tpl.HeaderText = sHEADER_TEXT ; tpl.SortExpression = sSORT_EXPRESSION ; tpl.ItemStyle.Width = new Unit(sITEMSTYLE_WIDTH); tpl.ItemStyle.CssClass = sITEMSTYLE_CSSCLASS; tpl.ItemStyle.HorizontalAlign = eHorizontalAlign ; tpl.ItemStyle.VerticalAlign = eVerticalAlign ; tpl.ItemStyle.Wrap = bITEMSTYLE_WRAP ; // 04/13/2007 Align the headers to match the data. tpl.HeaderStyle.HorizontalAlign = eHorizontalAlign ; // 10/09/2010 Add PARENT_FIELD so that we can establish dependent listboxes. tpl.ItemTemplate = new CreateItemTemplateLiteralList(sDATA_FIELD, sLIST_NAME, sPARENT_FIELD); col = tpl; // 01/18/2010 Apply ACL Field Security. col.Visible = bIsReadable; } } else if ( String.Compare(sCOLUMN_TYPE, "TemplateColumn", true) == 0 ) { // GRID_NAME, COLUMN_ORDER, COLUMN_TYPE, HEADER_TEXT, DATA_FIELD, SORT_EXPRESSION, ITEMSTYLE_WIDTH TemplateColumn tpl = new TemplateColumn(); tpl.HeaderText = sHEADER_TEXT ; tpl.SortExpression = sSORT_EXPRESSION ; tpl.ItemStyle.Width = new Unit(sITEMSTYLE_WIDTH); tpl.ItemStyle.CssClass = sITEMSTYLE_CSSCLASS; tpl.ItemStyle.HorizontalAlign = eHorizontalAlign ; tpl.ItemStyle.VerticalAlign = eVerticalAlign ; tpl.ItemStyle.Wrap = bITEMSTYLE_WRAP ; // 04/13/2007 Align the headers to match the data. tpl.HeaderStyle.HorizontalAlign = eHorizontalAlign ; if ( String.Compare(sDATA_FORMAT, "JavaScript", true) == 0 ) { // 08/02/2010 In our application of Field Level Security, we will hide fields by replacing with "." if ( SplendidInit.bEnableACLFieldSecurity && !Sql.IsEmptyString(sURL_FIELD) ) { string[] arrURL_FIELD = sURL_FIELD.Split(' '); for ( int i=0; i < arrURL_FIELD.Length; i++ ) { Security.ACL_FIELD_ACCESS acl = Security.GetUserFieldSecurity(sMODULE_NAME, sDATA_FIELD, Guid.Empty); if ( !acl.IsReadable() ) arrURL_FIELD[i] = "."; } sURL_FIELD = String.Join(" ", arrURL_FIELD); } tpl.ItemTemplate = new CreateItemTemplateJavaScript(sDATA_FIELD, sURL_FIELD, sURL_FORMAT, sURL_TARGET); } // 02/26/2014 Add Preview button. else if ( String.Compare(sDATA_FORMAT, "JavaImage", true) == 0 ) { if ( SplendidInit.bEnableACLFieldSecurity && !Sql.IsEmptyString(sURL_FIELD) ) { string[] arrURL_FIELD = sURL_FIELD.Split(' '); for ( int i=0; i < arrURL_FIELD.Length; i++ ) { Security.ACL_FIELD_ACCESS acl = Security.GetUserFieldSecurity(sMODULE_NAME, sDATA_FIELD, Guid.Empty); if ( !acl.IsReadable() ) arrURL_FIELD[i] = "."; } sURL_FIELD = String.Join(" ", arrURL_FIELD); } tpl.ItemTemplate = new CreateItemTemplateJavaScriptImage(sURL_FIELD, sURL_FORMAT, sURL_TARGET); } // 03/01/2014 Add Preview button. else if ( String.Compare(sDATA_FORMAT, "ImageButton", true) == 0 ) { // 03/01/2014 sURL_FIELD is an internal value, so there is no need to apply ACL rules. tpl.ItemTemplate = new CreateItemTemplateImageButton(sURL_FIELD, sURL_FORMAT, sURL_TARGET, sITEMSTYLE_CSSCLASS, Page_Command); } else if ( String.Compare(sDATA_FORMAT, "Hover", true) == 0 ) { string sIMAGE_SKIN = sURL_TARGET; if ( Sql.IsEmptyString(sIMAGE_SKIN) ) sIMAGE_SKIN = "info_inline"; // 08/02/2010 In our application of Field Level Security, we will hide fields by replacing with "." if ( SplendidInit.bEnableACLFieldSecurity && !Sql.IsEmptyString(sURL_FIELD) ) { string[] arrURL_FIELD = sURL_FIELD.Split(' '); for ( int i=0; i < arrURL_FIELD.Length; i++ ) { Security.ACL_FIELD_ACCESS acl = Security.GetUserFieldSecurity(sMODULE_NAME, sDATA_FIELD, Guid.Empty); if ( !acl.IsReadable() ) arrURL_FIELD[i] = "."; } sURL_FIELD = String.Join(" ", arrURL_FIELD); } tpl.ItemTemplate = new CreateItemTemplateHover(sDATA_FIELD, sURL_FIELD, sURL_FORMAT, sIMAGE_SKIN); } else if ( String.Compare(sDATA_FORMAT, "HyperLink", true) == 0 ) { // 07/26/2007 PopupViews have special requirements. They need an OnClick action that takes more than one parameter. if ( sURL_FIELD.IndexOf(' ') >= 0 ) tpl.ItemTemplate = new CreateItemTemplateHyperLinkOnClick(sDATA_FIELD, sURL_FIELD, sURL_FORMAT, sURL_TARGET, sITEMSTYLE_CSSCLASS, sURL_MODULE, sURL_ASSIGNED_FIELD, sMODULE_TYPE); else tpl.ItemTemplate = new CreateItemTemplateHyperLink(sDATA_FIELD, sURL_FIELD, sURL_FORMAT, sURL_TARGET, sITEMSTYLE_CSSCLASS, sURL_MODULE, sURL_ASSIGNED_FIELD, sMODULE_TYPE); } else if ( String.Compare(sDATA_FORMAT, "Image", true) == 0 ) { tpl.ItemTemplate = new CreateItemTemplateImage(sDATA_FIELD, sITEMSTYLE_CSSCLASS); } else { tpl.ItemStyle.CssClass = sITEMSTYLE_CSSCLASS; tpl.ItemTemplate = new CreateItemTemplateLiteral(sDATA_FIELD, sDATA_FORMAT, sMODULE_TYPE); } col = tpl; // 01/18/2010 Apply ACL Field Security. col.Visible = bIsReadable; } else if ( String.Compare(sCOLUMN_TYPE, "HyperLinkColumn", true) == 0 ) { // GRID_NAME, COLUMN_ORDER, COLUMN_TYPE, HEADER_TEXT, DATA_FIELD, SORT_EXPRESSION, ITEMSTYLE_WIDTH, ITEMSTYLE-CSSCLASS, URL_FIELD, URL_FORMAT HyperLinkColumn lnk = new HyperLinkColumn(); lnk.HeaderText = sHEADER_TEXT ; lnk.DataTextField = sDATA_FIELD ; lnk.SortExpression = sSORT_EXPRESSION ; lnk.DataNavigateUrlField = sURL_FIELD ; lnk.DataNavigateUrlFormatString = sURL_FORMAT ; lnk.Target = sURL_TARGET ; lnk.ItemStyle.Width = new Unit(sITEMSTYLE_WIDTH); lnk.ItemStyle.CssClass = sITEMSTYLE_CSSCLASS; lnk.ItemStyle.HorizontalAlign = eHorizontalAlign ; lnk.ItemStyle.VerticalAlign = eVerticalAlign ; lnk.ItemStyle.Wrap = bITEMSTYLE_WRAP ; // 04/13/2007 Align the headers to match the data. lnk.HeaderStyle.HorizontalAlign = eHorizontalAlign ; col = lnk; // 01/18/2010 Apply ACL Field Security. col.Visible = bIsReadable; } if ( col != null ) { // 11/25/2006 If Team Management has been disabled, then hide the column. // Keep the column, but hide it so that the remaining column positions will still be valid. // 10/27/2007 The data field was changed to TEAM_NAME on 11/25/2006. It should have been changed here as well. // 08/24/2009 Add support for dynamic teams. if ( (sDATA_FIELD == "TEAM_NAME" || sDATA_FIELD == "TEAM_SET_NAME") && !bEnableTeamManagement ) { col.Visible = false; } // 11/28/2005 In case the column specified is too high, just append column. if ( nCOLUMN_INDEX >= grd.Columns.Count ) grd.Columns.Add(col); else grd.Columns.AddAt(nCOLUMN_INDEX, col); } } } // 09/20/2012 We need a SCRIPT field that is form specific. if ( dt.Rows.Count > 0 ) { try { string sFORM_SCRIPT = Sql.ToString(dt.Rows[0]["SCRIPT"]); if ( !Sql.IsEmptyString(sFORM_SCRIPT) ) { // 09/20/2012 The base ID is not the ID of the parent, but the ID of the TemplateControl. sFORM_SCRIPT = sFORM_SCRIPT.Replace("SPLENDID_GRIDVIEW_LAYOUT_ID", grd.TemplateControl.ClientID); ScriptManager.RegisterStartupScript(grd, typeof(System.String), sGRID_NAME.Replace(".", "_") + "_SCRIPT", sFORM_SCRIPT, true); } } catch(Exception ex) { SplendidError.SystemWarning(new StackTrace(true).GetFrame(0), ex); } } }
private DataGridColumn c_hyper_link(bool v) { HyperLinkColumn column1 = new HyperLinkColumn(); column1.DataTextField = "ID"; column1.NavigateUrl = "http://www.google.com"; column1.Visible = v; return column1; }
public HyperLinkColumnItem(HyperLinkColumn runtimeColumn) : base(runtimeColumn, 8) { }
public static void AppendGridColumns(string sGRID_NAME, DataGrid grd, UniqueStringCollection arrSelectFields) { if (grd == null) { return; } DataTable dt = CRMCache.GridViewColumns(sGRID_NAME); if (dt != null) { DataView dv = dt.DefaultView; dv.Sort = "COLUMN_INDEX"; bool bEnableTeamManagement = Common.Config.enable_team_management(); foreach (DataRowView row in dv) { int nCOLUMN_INDEX = TypeConvert.ToInteger(row["COLUMN_INDEX"]); string sCOLUMN_TYPE = TypeConvert.ToString(row["COLUMN_TYPE"]); string sHEADER_TEXT = TypeConvert.ToString(row["HEADER_TEXT"]); string sSORT_EXPRESSION = TypeConvert.ToString(row["SORT_EXPRESSION"]); string sITEMSTYLE_WIDTH = TypeConvert.ToString(row["ITEMSTYLE_WIDTH"]); string sITEMSTYLE_CSSCLASS = TypeConvert.ToString(row["ITEMSTYLE_CSSCLASS"]); string sITEMSTYLE_HORIZONTAL_ALIGN = TypeConvert.ToString(row["ITEMSTYLE_HORIZONTAL_ALIGN"]); string sITEMSTYLE_VERTICAL_ALIGN = TypeConvert.ToString(row["ITEMSTYLE_VERTICAL_ALIGN"]); bool bITEMSTYLE_WRAP = TypeConvert.ToBoolean(row["ITEMSTYLE_WRAP"]); string sDATA_FIELD = TypeConvert.ToString(row["DATA_FIELD"]); string sDATA_FORMAT = TypeConvert.ToString(row["DATA_FORMAT"]); string sURL_FIELD = TypeConvert.ToString(row["URL_FIELD"]); string sURL_FORMAT = TypeConvert.ToString(row["URL_FORMAT"]); string sURL_TARGET = TypeConvert.ToString(row["URL_TARGET"]); string sLIST_NAME = TypeConvert.ToString(row["LIST_NAME"]); string sURL_MODULE = TypeConvert.ToString(row["URL_MODULE"]); string sURL_ASSIGNED_FIELD = TypeConvert.ToString(row["URL_ASSIGNED_FIELD"]); if (arrSelectFields != null) { arrSelectFields.Add(sDATA_FIELD); if (!TypeConvert.IsEmptyString(sSORT_EXPRESSION)) arrSelectFields.Add(sSORT_EXPRESSION); if (!TypeConvert.IsEmptyString(sURL_FIELD)) { if (sURL_FIELD.IndexOf(' ') >= 0) arrSelectFields.AddRange(sURL_FIELD.Split(' ')); else arrSelectFields.Add(sURL_FIELD); if (!TypeConvert.IsEmptyString(sURL_ASSIGNED_FIELD)) arrSelectFields.Add(sURL_ASSIGNED_FIELD); } } HorizontalAlign eHorizontalAlign = HorizontalAlign.NotSet; switch (sITEMSTYLE_HORIZONTAL_ALIGN.ToLower()) { case "left": eHorizontalAlign = HorizontalAlign.Left; break; case "right": eHorizontalAlign = HorizontalAlign.Right; break; } VerticalAlign eVerticalAlign = VerticalAlign.NotSet; switch (sITEMSTYLE_VERTICAL_ALIGN.ToLower()) { case "top": eVerticalAlign = VerticalAlign.Top; break; case "middle": eVerticalAlign = VerticalAlign.Middle; break; case "bottom": eVerticalAlign = VerticalAlign.Bottom; break; } if (row["ITEMSTYLE_WRAP"] == DBNull.Value) bITEMSTYLE_WRAP = true; DataGridColumn col = null; if (String.Compare(sCOLUMN_TYPE, "BoundColumn", true) == 0 && (String.Compare(sDATA_FORMAT, "Date", true) == 0 || String.Compare(sDATA_FORMAT, "DateTime", true) == 0 || String.Compare(sDATA_FORMAT, "Currency", true) == 0 || String.Compare(sDATA_FORMAT, "Image", true) == 0 ) ) { sCOLUMN_TYPE = "TemplateColumn"; } if (String.Compare(sCOLUMN_TYPE, "BoundColumn", true) == 0) { if (TypeConvert.IsEmptyString(sLIST_NAME)) { BoundColumn bnd = new BoundColumn(); bnd.HeaderText = sHEADER_TEXT; bnd.DataField = sDATA_FIELD; bnd.SortExpression = sSORT_EXPRESSION; bnd.ItemStyle.Width = new Unit(sITEMSTYLE_WIDTH); bnd.ItemStyle.CssClass = sITEMSTYLE_CSSCLASS; bnd.ItemStyle.HorizontalAlign = eHorizontalAlign; bnd.ItemStyle.VerticalAlign = eVerticalAlign; bnd.ItemStyle.Wrap = bITEMSTYLE_WRAP; bnd.HeaderStyle.HorizontalAlign = eHorizontalAlign; col = bnd; } else { TemplateColumn tpl = new TemplateColumn(); tpl.HeaderText = sHEADER_TEXT; tpl.SortExpression = sSORT_EXPRESSION; tpl.ItemStyle.Width = new Unit(sITEMSTYLE_WIDTH); tpl.ItemStyle.CssClass = sITEMSTYLE_CSSCLASS; tpl.ItemStyle.HorizontalAlign = eHorizontalAlign; tpl.ItemStyle.VerticalAlign = eVerticalAlign; tpl.ItemStyle.Wrap = bITEMSTYLE_WRAP; tpl.HeaderStyle.HorizontalAlign = eHorizontalAlign; tpl.ItemTemplate = new CreateItemTemplateLiteralList(sDATA_FIELD, sLIST_NAME); col = tpl; } } else if (String.Compare(sCOLUMN_TYPE, "TemplateColumn", true) == 0) { TemplateColumn tpl = new TemplateColumn(); tpl.HeaderText = sHEADER_TEXT; tpl.SortExpression = sSORT_EXPRESSION; tpl.ItemStyle.Width = new Unit(sITEMSTYLE_WIDTH); tpl.ItemStyle.CssClass = sITEMSTYLE_CSSCLASS; tpl.ItemStyle.HorizontalAlign = eHorizontalAlign; tpl.ItemStyle.VerticalAlign = eVerticalAlign; tpl.ItemStyle.Wrap = bITEMSTYLE_WRAP; tpl.HeaderStyle.HorizontalAlign = eHorizontalAlign; if (String.Compare(sDATA_FORMAT, "HyperLink", true) == 0) { if (sURL_FIELD.IndexOf(' ') >= 0) tpl.ItemTemplate = new CreateItemTemplateHyperLinkOnClick(sDATA_FIELD, sURL_FIELD, sURL_FORMAT, sURL_TARGET, sITEMSTYLE_CSSCLASS, sURL_MODULE, sURL_ASSIGNED_FIELD); else tpl.ItemTemplate = new CreateItemTemplateHyperLink(sDATA_FIELD, sURL_FIELD, sURL_FORMAT, sURL_TARGET, sITEMSTYLE_CSSCLASS, sURL_MODULE, sURL_ASSIGNED_FIELD); } else if (String.Compare(sDATA_FORMAT, "Image", true) == 0) { tpl.ItemTemplate = new CreateItemTemplateImage(sDATA_FIELD, sITEMSTYLE_CSSCLASS); } else { tpl.ItemStyle.CssClass = sITEMSTYLE_CSSCLASS; tpl.ItemTemplate = new CreateItemTemplateLiteral(sDATA_FIELD, sDATA_FORMAT); } col = tpl; } else if (String.Compare(sCOLUMN_TYPE, "HyperLinkColumn", true) == 0) { HyperLinkColumn lnk = new HyperLinkColumn(); lnk.HeaderText = sHEADER_TEXT; lnk.DataTextField = sDATA_FIELD; lnk.SortExpression = sSORT_EXPRESSION; lnk.DataNavigateUrlField = sURL_FIELD; lnk.DataNavigateUrlFormatString = sURL_FORMAT; lnk.Target = sURL_TARGET; lnk.ItemStyle.Width = new Unit(sITEMSTYLE_WIDTH); lnk.ItemStyle.CssClass = sITEMSTYLE_CSSCLASS; lnk.ItemStyle.HorizontalAlign = eHorizontalAlign; lnk.ItemStyle.VerticalAlign = eVerticalAlign; lnk.ItemStyle.Wrap = bITEMSTYLE_WRAP; lnk.HeaderStyle.HorizontalAlign = eHorizontalAlign; col = lnk; } if (col != null) { if (sDATA_FIELD == "TEAM_NAME" && !bEnableTeamManagement) { col.Visible = false; } if (nCOLUMN_INDEX >= grd.Columns.Count) grd.Columns.Add(col); else grd.Columns.AddAt(nCOLUMN_INDEX, col); } } } }
private void setReportType(string type) { if (type.Equals(ProjectItem.ItemType.TASK)) return; HyperLinkColumn col = new HyperLinkColumn(); col.DataTextField = "name"; col.DataNavigateUrlField = "id"; // set item type to be displayed string item = ""; if (type.Equals(ProjectItem.ItemType.PROJECT)) item = ProjectItem.ItemType.MODULE; else if(type.Equals(ProjectItem.ItemType.MODULE)) item = ProjectItem.ItemType.TASK; col.DataNavigateUrlFormatString = Request.ApplicationPath + "/PM/Projects.aspx?item="+item+"&id={0}"; DisplayGrid.Columns.Remove(DisplayGrid.Columns[1]); DisplayGrid.Columns.AddAt(1, col); }
private void Page_Load(object sender, System.EventArgs e) { //Put user code to initialize the page here System.Web.UI.HtmlControls.HtmlForm frm = (HtmlForm)this.FindControl("Form1"); GHTTestBegin(frm); GHTActiveSubTest = GHTSubTest1; try { DataGrid1.DataSource = GHTTests.GHDataSources.DSDataTable(); System.Web.UI.WebControls.HyperLinkColumn c_id = new System.Web.UI.WebControls.HyperLinkColumn(); System.Web.UI.WebControls.HyperLinkColumn c_name = new System.Web.UI.WebControls.HyperLinkColumn(); System.Web.UI.WebControls.HyperLinkColumn c_company = new System.Web.UI.WebControls.HyperLinkColumn(); c_id.DataNavigateUrlField = ""; c_id.DataNavigateUrlFormatString = ""; c_id.Text = "123"; c_name.DataNavigateUrlField = "Name"; c_name.DataNavigateUrlFormatString = "(format str)"; c_name.Text = "123"; c_company.DataNavigateUrlField = "Company"; c_company.DataNavigateUrlFormatString = "{0:c5}"; c_company.Text = "123"; DataGrid1.Columns.Add(c_id); DataGrid1.Columns.Add(c_name); DataGrid1.Columns.Add(c_company); DataGrid1.DataBind();; GHTSubTestAddResult(c_id.DataNavigateUrlFormatString); GHTSubTestAddResult(c_name.DataNavigateUrlFormatString); GHTSubTestAddResult(c_company.DataNavigateUrlFormatString); } catch (Exception ex) { GHTSubTestUnexpectedExceptionCaught(ex); } GHTActiveSubTest = Ghtsubtest2; try { DataGrid2.DataSource = GHTTests.GHDataSources.DSDataTable(); System.Web.UI.WebControls.HyperLinkColumn c_id = new System.Web.UI.WebControls.HyperLinkColumn(); c_id.DataNavigateUrlField = "ID"; c_id.DataNavigateUrlFormatString = "{0:c5}"; c_id.Text = "123"; DataGrid2.Columns.Add(c_id); DataGrid2.DataBind();; GHTSubTestAddResult(c_id.DataNavigateUrlFormatString); } catch (Exception ex) { GHTSubTestUnexpectedExceptionCaught(ex); } GHTActiveSubTest = Ghtsubtest3; try { DataGrid3.DataSource = GHTTests.GHDataSources.DSDataTable(); DataGrid3.DataBind();; GHTSubTestAddResult(( (System.Web.UI.WebControls.HyperLinkColumn)DataGrid3.Columns[0] ).DataNavigateUrlFormatString); GHTSubTestAddResult(( (System.Web.UI.WebControls.HyperLinkColumn)DataGrid3.Columns[1] ).DataNavigateUrlFormatString); GHTSubTestAddResult(( (System.Web.UI.WebControls.HyperLinkColumn)DataGrid3.Columns[2] ).DataNavigateUrlFormatString); } catch (Exception ex) { GHTSubTestUnexpectedExceptionCaught(ex); } GHTActiveSubTest = Ghtsubtest4; try { DataGrid4.DataSource = GHTTests.GHDataSources.DSDataTable(); DataGrid4.DataBind();; GHTSubTestAddResult(( (System.Web.UI.WebControls.HyperLinkColumn)DataGrid4.Columns[0]).DataNavigateUrlFormatString); GHTSubTestAddResult(( (System.Web.UI.WebControls.HyperLinkColumn)DataGrid4.Columns[1]).DataNavigateUrlFormatString); GHTSubTestAddResult(( (System.Web.UI.WebControls.HyperLinkColumn)DataGrid4.Columns[2]).DataNavigateUrlFormatString); } catch (Exception ex) { GHTSubTestUnexpectedExceptionCaught(ex); } GHTTestEnd(); }
public static void AppendGridColumns(string sGRID_NAME, DataGrid grd) { if ( grd == null ) { SplendidError.SystemWarning(new StackTrace(true).GetFrame(0), "DataGrid is not defined for " + sGRID_NAME); return; } DataTable dt = SplendidCache.GridViewColumns(sGRID_NAME); if ( dt != null ) { foreach(DataRow row in dt.Rows) { int nCOLUMN_INDEX = Sql.ToInteger(row["COLUMN_INDEX" ]); string sCOLUMN_TYPE = Sql.ToString (row["COLUMN_TYPE" ]); string sHEADER_TEXT = Sql.ToString (row["HEADER_TEXT" ]); string sSORT_EXPRESSION = Sql.ToString (row["SORT_EXPRESSION" ]); string sITEMSTYLE_WIDTH = Sql.ToString (row["ITEMSTYLE_WIDTH" ]); string sITEMSTYLE_CSSCLASS = Sql.ToString (row["ITEMSTYLE_CSSCLASS" ]); string sITEMSTYLE_HORIZONTAL_ALIGN = Sql.ToString (row["ITEMSTYLE_HORIZONTAL_ALIGN"]); string sITEMSTYLE_VERTICAL_ALIGN = Sql.ToString (row["ITEMSTYLE_VERTICAL_ALIGN" ]); bool bITEMSTYLE_WRAP = Sql.ToBoolean(row["ITEMSTYLE_WRAP" ]); string sDATA_FIELD = Sql.ToString (row["DATA_FIELD" ]); string sDATA_FORMAT = Sql.ToString (row["DATA_FORMAT" ]); string sURL_FIELD = Sql.ToString (row["URL_FIELD" ]); string sURL_FORMAT = Sql.ToString (row["URL_FORMAT" ]); string sURL_TARGET = Sql.ToString (row["URL_TARGET" ]); string sLIST_NAME = Sql.ToString (row["LIST_NAME" ]); // 04/28/2006 Paul. The module is necessary in order to determine if a user has access. string sURL_MODULE = Sql.ToString (row["URL_MODULE" ]); // 05/02/2006 Paul. The assigned user id is necessary if the user only has Owner access. string sURL_ASSIGNED_FIELD = Sql.ToString (row["URL_ASSIGNED_FIELD" ]); HorizontalAlign eHorizontalAlign = HorizontalAlign.NotSet; switch ( sITEMSTYLE_HORIZONTAL_ALIGN.ToLower() ) { case "left" : eHorizontalAlign = HorizontalAlign.Left ; break; case "right": eHorizontalAlign = HorizontalAlign.Right; break; } VerticalAlign eVerticalAlign = VerticalAlign.NotSet; switch ( sITEMSTYLE_VERTICAL_ALIGN.ToLower() ) { case "top" : eVerticalAlign = VerticalAlign.Top ; break; case "middle": eVerticalAlign = VerticalAlign.Middle; break; case "bottom": eVerticalAlign = VerticalAlign.Bottom; break; } // 11/28/2005 Paul. Wrap defaults to true. if ( row["ITEMSTYLE_WRAP"] == DBNull.Value ) bITEMSTYLE_WRAP = true; DataGridColumn col = null; // 02/03/2006 Paul. Date and Currency must always be handled by CreateItemTemplateLiteral. // Otherwise, the date or time will not get properly translated to the correct timezone. // This bug was reported by David Williams. if ( String.Compare(sCOLUMN_TYPE, "BoundColumn", true) == 0 && ( String.Compare(sDATA_FORMAT, "Date" , true) == 0 || String.Compare(sDATA_FORMAT, "DateTime", true) == 0 || String.Compare(sDATA_FORMAT, "Currency", true) == 0 || String.Compare(sDATA_FORMAT, "Image" , true) == 0 ) ) { sCOLUMN_TYPE = "TemplateColumn"; } if ( String.Compare(sCOLUMN_TYPE, "BoundColumn", true) == 0 ) { if ( Sql.IsEmptyString(sLIST_NAME) ) { // GRID_NAME, COLUMN_ORDER, COLUMN_TYPE, HEADER_TEXT, DATA_FIELD, SORT_EXPRESSION, ITEMSTYLE_WIDTH BoundColumn bnd = new BoundColumn(); bnd.HeaderText = sHEADER_TEXT ; bnd.DataField = sDATA_FIELD ; bnd.SortExpression = sSORT_EXPRESSION ; bnd.ItemStyle.Width = new Unit(sITEMSTYLE_WIDTH); bnd.ItemStyle.CssClass = sITEMSTYLE_CSSCLASS; bnd.ItemStyle.HorizontalAlign = eHorizontalAlign ; bnd.ItemStyle.VerticalAlign = eVerticalAlign ; bnd.ItemStyle.Wrap = bITEMSTYLE_WRAP ; col = bnd; } else { // GRID_NAME, COLUMN_ORDER, COLUMN_TYPE, HEADER_TEXT, DATA_FIELD, SORT_EXPRESSION, ITEMSTYLE_WIDTH TemplateColumn tpl = new TemplateColumn(); tpl.HeaderText = sHEADER_TEXT ; tpl.SortExpression = sSORT_EXPRESSION ; tpl.ItemStyle.Width = new Unit(sITEMSTYLE_WIDTH); tpl.ItemStyle.CssClass = sITEMSTYLE_CSSCLASS; tpl.ItemStyle.HorizontalAlign = eHorizontalAlign ; tpl.ItemStyle.VerticalAlign = eVerticalAlign ; tpl.ItemStyle.Wrap = bITEMSTYLE_WRAP ; tpl.ItemTemplate = new CreateItemTemplateLiteralList(sDATA_FIELD, sLIST_NAME); col = tpl; } } else if ( String.Compare(sCOLUMN_TYPE, "TemplateColumn", true) == 0 ) { // GRID_NAME, COLUMN_ORDER, COLUMN_TYPE, HEADER_TEXT, DATA_FIELD, SORT_EXPRESSION, ITEMSTYLE_WIDTH TemplateColumn tpl = new TemplateColumn(); tpl.HeaderText = sHEADER_TEXT ; tpl.SortExpression = sSORT_EXPRESSION ; tpl.ItemStyle.Width = new Unit(sITEMSTYLE_WIDTH); tpl.ItemStyle.CssClass = sITEMSTYLE_CSSCLASS; tpl.ItemStyle.HorizontalAlign = eHorizontalAlign ; tpl.ItemStyle.VerticalAlign = eVerticalAlign ; tpl.ItemStyle.Wrap = bITEMSTYLE_WRAP ; if ( String.Compare(sDATA_FORMAT, "HyperLink", true) == 0 ) { tpl.ItemTemplate = new CreateItemTemplateHyperLink(sDATA_FIELD, sURL_FIELD, sURL_FORMAT, sURL_TARGET, sITEMSTYLE_CSSCLASS, sURL_MODULE, sURL_ASSIGNED_FIELD); } else if ( String.Compare(sDATA_FORMAT, "Image", true) == 0 ) { tpl.ItemTemplate = new CreateItemTemplateImage(sDATA_FIELD, sITEMSTYLE_CSSCLASS); } else { tpl.ItemStyle.CssClass = sITEMSTYLE_CSSCLASS; tpl.ItemTemplate = new CreateItemTemplateLiteral(sDATA_FIELD, sDATA_FORMAT); } col = tpl; } else if ( String.Compare(sCOLUMN_TYPE, "HyperLinkColumn", true) == 0 ) { // GRID_NAME, COLUMN_ORDER, COLUMN_TYPE, HEADER_TEXT, DATA_FIELD, SORT_EXPRESSION, ITEMSTYLE_WIDTH, ITEMSTYLE-CSSCLASS, URL_FIELD, URL_FORMAT HyperLinkColumn lnk = new HyperLinkColumn(); lnk.HeaderText = sHEADER_TEXT ; lnk.DataTextField = sDATA_FIELD ; lnk.SortExpression = sSORT_EXPRESSION ; lnk.DataNavigateUrlField = sURL_FIELD ; lnk.DataNavigateUrlFormatString = sURL_FORMAT ; lnk.Target = sURL_TARGET ; lnk.ItemStyle.Width = new Unit(sITEMSTYLE_WIDTH); lnk.ItemStyle.CssClass = sITEMSTYLE_CSSCLASS; lnk.ItemStyle.HorizontalAlign = eHorizontalAlign ; lnk.ItemStyle.VerticalAlign = eVerticalAlign ; lnk.ItemStyle.Wrap = bITEMSTYLE_WRAP ; col = lnk; } if ( col != null ) { // 11/28/2005 Paul. In case the column specified is too high, just append column. if ( nCOLUMN_INDEX >= grd.Columns.Count ) grd.Columns.Add(col); else grd.Columns.AddAt(nCOLUMN_INDEX, col); } } } }
private ArrayList GetGridColumns( string linkFieldName ) { ArrayList columns = new ArrayList(); OrderColumns(); foreach( ViewMap vm in viewMaps ) { if( vm.Style != null && vm.Style == "hyperlink" ) { if( linkFieldName == null ) { Check.VerifyNotNull( vm.PrimaryKeyName, Error.NullParameter, "PrimaryKeyName" ); linkFieldName = vm.PrimaryKeyName; } HyperLinkColumn column = new HyperLinkColumn(); column.DataTextField = vm.PropertyName; column.DataNavigateUrlField = linkFieldName; column.DataNavigateUrlFormatString = vm.NavigateUrlFormat; column.HeaderText = vm.ColumnName; column.SortExpression = vm.PropertyName; column.DataTextFormatString = vm.FormatString; columns.Add( column ); } else { BoundColumn column = new BoundColumn(); column.HeaderText = vm.ColumnName; column.SortExpression = vm.PropertyName; column.DataField = vm.PropertyName; column.DataFormatString = vm.FormatString; columns.Add( column ); } } return columns; }
// ======================= // Dynamic Control.ID // ======================= // In order to catch these values the dynamically generated controls // needs to be re-generated at Page_Load. // The important thing is to assign the same ID to each control. // The ViewState uses the ID property of the Control objects to reinstate the values. // // ======================= // Page.IsPostBack // ======================= // We set the contrro//s tested member with a value // only at the first time the page is loaded // // private void Page_Load(object sender, EventArgs e) { HtmlForm form1 = (HtmlForm) (HtmlForm)this.FindControl("Form1"); this.GHTTestBegin(form1); this.GHTSubTestBegin("Check PostBack"); try { if (this.Page.IsPostBack) { this.GHTSubTestAddResult("PostBack Worked!!!"); } } catch (Exception exception49) { // ProjectData.SetProjectError(exception49); Exception exception1 = exception49; this.GHTSubTestAddResult("Unxpected " + exception1.GetType().Name + " exception was caught-" + exception1.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("AdRotator.KeywordFilter,Target"); try { AdRotator rotator1 = new AdRotator(); rotator1.ID = "objAdRotatorAll"; base.GHTActiveForm.Controls.Add(rotator1); if (!this.Page.IsPostBack) { rotator1.KeywordFilter = "test"; rotator1.Target = "_blank"; } else { this.GHTSubTestAddResult(rotator1.KeywordFilter); this.GHTSubTestAddResult(rotator1.Target); } } catch (Exception exception50) { // ProjectData.SetProjectError(exception50); Exception exception2 = exception50; this.GHTSubTestAddResult("Unxpected " + exception2.GetType().Name + " exception was caught-" + exception2.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); Label label1 = new Label(); this.GHTSubTestBegin("Style.BorderColor,BorderWidth,BorderStyle,CssClass,ForeColor,Height,Width,BackColor"); try { label1.ID = "objStyleLabelAll"; base.GHTActiveForm.Controls.Add(label1); if (!this.Page.IsPostBack) { label1.Style["BorderColor"] = "ffffff"; label1.Style["ForeColor"] = "ffffff"; label1.Style["BackColor"] = "ffffff"; label1.Style["BorderWidth"] = "2"; label1.Style["BorderStyle"] = "3"; label1.Style["CssClass"] = "CssClass"; label1.Style["Height"] = "2"; label1.Style["Width"] = "2"; } else { this.GHTSubTestAddResult(label1.Style["BorderColor"]); this.GHTSubTestAddResult(label1.Style["ForeColor"]); this.GHTSubTestAddResult(label1.Style["BackColor"]); this.GHTSubTestAddResult(label1.Style["BorderWidth"]); this.GHTSubTestAddResult(label1.Style["BorderStyle"]); this.GHTSubTestAddResult(label1.Style["CssClass"]); this.GHTSubTestAddResult(label1.Style["Height"]); this.GHTSubTestAddResult(label1.Style["Width"]); } } catch (Exception exception51) { // ProjectData.SetProjectError(exception51); Exception exception3 = exception51; this.GHTSubTestAddResult("Unxpected " + exception3.GetType().Name + " exception was caught-" + exception3.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("FontInfo.Underline,Italic,Names,Overline,Size,Strikeout,Bold"); try { if (!this.Page.IsPostBack) { label1.Font.Underline = true; label1.Font.Italic = true; label1.Font.Names.SetValue("myfont", 1); label1.Font.Overline = true; label1.Font.Size = FontUnit.Medium; label1.Font.Strikeout = true; label1.Font.Bold = true; } else { this.GHTSubTestAddResult(label1.Font.Underline.ToString()); this.GHTSubTestAddResult(label1.Font.Italic.ToString()); this.GHTSubTestAddResult((string)(label1.Font.Names.GetValue(1))); this.GHTSubTestAddResult(label1.Font.Overline.ToString()); this.GHTSubTestAddResult(label1.Font.Size.ToString()); this.GHTSubTestAddResult(label1.Font.Strikeout.ToString()); this.GHTSubTestAddResult(label1.Font.Bold.ToString()); } } catch (IndexOutOfRangeException exception52) { this.GHTSubTestAddResult("Test passed"); } this.GHTSubTestEnd(); this.GHTSubTestBegin("Control.Visible"); try { Button button1 = new Button(); button1.ID = "objControlAll"; base.GHTActiveForm.Controls.Add(button1); if (!this.Page.IsPostBack) { button1.Visible = false; } else { this.GHTSubTestAddResult(button1.Visible.ToString()); } } catch (Exception exception53) { // ProjectData.SetProjectError(exception53); Exception exception5 = exception53; this.GHTSubTestAddResult("Unxpected " + exception5.GetType().Name + " exception was caught-" + exception5.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("WebControl.AccessKey,Enabled,TabIndex,ToolTip"); try { Button button2 = new Button(); button2.ID = "objWebControlAll"; base.GHTActiveForm.Controls.Add(button2); if (!this.Page.IsPostBack) { button2.AccessKey = "F"; button2.Enabled = false; button2.TabIndex = 100; button2.ToolTip = "ToolTip"; } else { this.GHTSubTestAddResult(button2.AccessKey); this.GHTSubTestAddResult(button2.Enabled.ToString()); this.GHTSubTestAddResult(button2.TabIndex.ToString()); this.GHTSubTestAddResult(button2.ToolTip); } } catch (Exception exception54) { // ProjectData.SetProjectError(exception54); Exception exception6 = exception54; this.GHTSubTestAddResult("Unxpected " + exception6.GetType().Name + " exception was caught-" + exception6.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("Button.CausesValidation,CommandArgument,CommandName,Text"); try { Button button3 = new Button(); button3.ID = "objButtonAll"; base.GHTActiveForm.Controls.Add(button3); if (!this.Page.IsPostBack) { button3.CausesValidation = true; button3.CommandArgument = "test"; button3.CommandName = "test"; button3.Text = "test"; } else { this.GHTSubTestAddResult(button3.CausesValidation.ToString()); this.GHTSubTestAddResult(button3.CommandArgument); this.GHTSubTestAddResult(button3.CommandName); this.GHTSubTestAddResult(button3.Text); } } catch (Exception exception55) { // ProjectData.SetProjectError(exception55); Exception exception7 = exception55; this.GHTSubTestAddResult("Unxpected " + exception7.GetType().Name + " exception was caught-" + exception7.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); DataGrid grid1 = new DataGrid(); grid1.ID = "objDataGrid"; grid1.AutoGenerateColumns = false; BoundColumn column1 = new BoundColumn(); column1.HeaderText = "IntegerValue"; column1.DataField = "IntegerValue"; grid1.Columns.Add(column1); column1 = new BoundColumn(); column1.HeaderText = "StringValue"; column1.DataField = "StringValue"; grid1.Columns.Add(column1); column1 = new BoundColumn(); column1.HeaderText = "CurrencyValue"; column1.DataField = "CurrencyValue"; grid1.Columns.Add(column1); HyperLinkColumn column4 = new HyperLinkColumn(); column4.HeaderText = "objHyperLinkColumn"; grid1.Columns.Add(column4); ButtonColumn column2 = new ButtonColumn(); column2.HeaderText = "ButtonColumn"; grid1.Columns.Add(column2); EditCommandColumn column3 = new EditCommandColumn(); column3.HeaderText = "EditCommandColumn"; grid1.Columns.Add(column3); grid1.DataSource = this.CreateDataSource(); grid1.DataBind(); base.GHTActiveForm.Controls.Add(grid1); this.GHTSubTestBegin("BoundColumn.All"); try { column1 = (BoundColumn) grid1.Columns[2]; if (!this.Page.IsPostBack) { column1.DataFormatString = "{0:C}"; column1.ReadOnly = true; column1.DataField = "IntegerValue"; } else { this.GHTSubTestAddResult(column1.DataFormatString); this.GHTSubTestAddResult(column1.ReadOnly.ToString()); this.GHTSubTestAddResult(column1.DataField); } } catch (Exception exception56) { // ProjectData.SetProjectError(exception56); Exception exception8 = exception56; this.GHTSubTestAddResult("Unxpected " + exception8.GetType().Name + " exception was caught-" + exception8.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("HyperLinkColumn.All"); try { if (!this.Page.IsPostBack) { column4.Text = "test"; column4.DataNavigateUrlFormatString = "test.aspx?id={0}"; column4.Target = "_blank"; column4.NavigateUrl = "test"; column4.DataTextField = "StringValue"; column4.DataNavigateUrlField = "StringValue"; column4.DataTextFormatString = "{0:C}"; } else { this.GHTSubTestAddResult(column4.Text); this.GHTSubTestAddResult(column4.DataNavigateUrlFormatString); this.GHTSubTestAddResult(column4.Target); this.GHTSubTestAddResult(column4.NavigateUrl); this.GHTSubTestAddResult(column4.DataTextField); this.GHTSubTestAddResult(column4.DataNavigateUrlField); this.GHTSubTestAddResult(column4.DataTextFormatString); } } catch (Exception exception57) { // ProjectData.SetProjectError(exception57); Exception exception9 = exception57; this.GHTSubTestAddResult("Unxpected " + exception9.GetType().Name + " exception was caught-" + exception9.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("ButtonColumn.All"); try { column2 = (ButtonColumn) grid1.Columns[4]; if (!this.Page.IsPostBack) { column2.DataTextField = "StringValue"; //column2.ButtonType = (ButtonColumnType) "test"; column2.DataTextFormatString = "{0:C}"; } else { this.GHTSubTestAddResult(column2.DataTextField); this.GHTSubTestAddResult(((int) column2.ButtonType).ToString()); this.GHTSubTestAddResult(column2.DataTextFormatString); } } catch (Exception exception58) { // ProjectData.SetProjectError(exception58); Exception exception10 = exception58; this.GHTSubTestAddResult("Unxpected " + exception10.GetType().Name + " exception was caught-" + exception10.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("EditCommandColumn.All"); try { column3 = (EditCommandColumn) grid1.Columns[5]; if (!this.Page.IsPostBack) { column3.UpdateText = "test"; column3.CancelText = "test"; column3.EditText = "test"; column3.ButtonType = ButtonColumnType.PushButton; } else { this.GHTSubTestAddResult(column3.UpdateText); this.GHTSubTestAddResult(column3.CancelText); this.GHTSubTestAddResult(column3.EditText); this.GHTSubTestAddResult(((int) column3.ButtonType).ToString()); } } catch (Exception exception59) { // ProjectData.SetProjectError(exception59); Exception exception11 = exception59; this.GHTSubTestAddResult("Unxpected " + exception11.GetType().Name + " exception was caught-" + exception11.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("Calendar.All"); try { Calendar calendar1 = new Calendar(); calendar1.ID = "objCalendarAll"; base.GHTActiveForm.Controls.Add(calendar1); if (!this.Page.IsPostBack) { calendar1.ShowDayHeader = true; calendar1.FirstDayOfWeek = FirstDayOfWeek.Tuesday; calendar1.SelectWeekText = "SelectWeekText"; calendar1.CellSpacing = 4; calendar1.CellPadding = 6; calendar1.SelectMonthText = "SelectMonthText"; calendar1.VisibleDate = DateTime.Now; calendar1.DayNameFormat = DayNameFormat.FirstTwoLetters; calendar1.ShowGridLines = true; calendar1.TodaysDate = DateTime.Now.AddDays(1); calendar1.ShowNextPrevMonth = true; calendar1.ShowTitle = true; calendar1.TitleFormat = TitleFormat.MonthYear; calendar1.NextMonthText = "NextMonthText"; calendar1.NextPrevFormat = NextPrevFormat.FullMonth; calendar1.PrevMonthText = "PrevMonthText"; calendar1.SelectionMode = CalendarSelectionMode.DayWeekMonth; } else { this.GHTSubTestAddResult(calendar1.ShowDayHeader.ToString()); this.GHTSubTestAddResult(((int) calendar1.FirstDayOfWeek).ToString()); this.GHTSubTestAddResult(calendar1.SelectWeekText); this.GHTSubTestAddResult(calendar1.CellSpacing.ToString()); this.GHTSubTestAddResult(calendar1.CellPadding.ToString()); this.GHTSubTestAddResult(calendar1.SelectMonthText); this.GHTSubTestAddResult(calendar1.VisibleDate.ToString()); this.GHTSubTestAddResult(((int) calendar1.DayNameFormat).ToString()); this.GHTSubTestAddResult(calendar1.ShowGridLines.ToString()); this.GHTSubTestAddResult(calendar1.TodaysDate.ToString()); this.GHTSubTestAddResult(calendar1.ShowNextPrevMonth.ToString()); this.GHTSubTestAddResult(calendar1.ShowTitle.ToString()); this.GHTSubTestAddResult(((int) calendar1.TitleFormat).ToString()); this.GHTSubTestAddResult(calendar1.NextMonthText); this.GHTSubTestAddResult(((int) calendar1.NextPrevFormat).ToString()); this.GHTSubTestAddResult(calendar1.PrevMonthText); this.GHTSubTestAddResult(((int) calendar1.SelectionMode).ToString()); } } catch (Exception exception60) { // ProjectData.SetProjectError(exception60); Exception exception12 = exception60; this.GHTSubTestAddResult("Unxpected " + exception12.GetType().Name + " exception was caught-" + exception12.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("CheckBox.TextAlign,Text,Checked,AutoPostBack"); try { CheckBox box2 = new CheckBox(); box2.ID = "objCheckBoxAll"; base.GHTActiveForm.Controls.Add(box2); if (!this.Page.IsPostBack) { box2.TextAlign = TextAlign.Left; box2.Text = "test"; box2.Checked = true; box2.Checked = true; } else { this.GHTSubTestAddResult(((int) box2.TextAlign).ToString()); this.GHTSubTestAddResult(box2.Text); this.GHTSubTestAddResult(box2.Checked.ToString()); this.GHTSubTestAddResult(box2.Checked.ToString()); } } catch (Exception exception61) { // ProjectData.SetProjectError(exception61); Exception exception13 = exception61; this.GHTSubTestAddResult("Unxpected " + exception13.GetType().Name + " exception was caught-" + exception13.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("CheckBoxList.RepeatColumns"); try { CheckBoxList list1 = new CheckBoxList(); list1.ID = "objCheckBoxListRepeatColumns"; base.GHTActiveForm.Controls.Add(list1); if (!this.Page.IsPostBack) { list1.RepeatColumns = 2; } else { this.GHTSubTestAddResult(list1.RepeatColumns.ToString()); } } catch (Exception exception62) { // ProjectData.SetProjectError(exception62); Exception exception14 = exception62; this.GHTSubTestAddResult("Unxpected " + exception14.GetType().Name + " exception was caught-" + exception14.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("CheckBoxList.TextAlign"); try { CheckBoxList list2 = new CheckBoxList(); list2.ID = "objCheckBoxListTextAlign"; base.GHTActiveForm.Controls.Add(list2); if (!this.Page.IsPostBack) { list2.TextAlign = TextAlign.Right; } else { this.GHTSubTestAddResult(((int) list2.TextAlign).ToString()); } } catch (Exception exception63) { // ProjectData.SetProjectError(exception63); Exception exception15 = exception63; this.GHTSubTestAddResult("Unxpected " + exception15.GetType().Name + " exception was caught-" + exception15.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("CheckBoxList.RepeatDirection"); try { CheckBoxList list3 = new CheckBoxList(); list3.ID = "objCheckBoxListRepeatDirection"; base.GHTActiveForm.Controls.Add(list3); if (!this.Page.IsPostBack) { list3.RepeatDirection = RepeatDirection.Horizontal; } else { this.GHTSubTestAddResult(((int) list3.RepeatDirection).ToString()); } } catch (Exception exception64) { // ProjectData.SetProjectError(exception64); Exception exception16 = exception64; this.GHTSubTestAddResult("Unxpected " + exception16.GetType().Name + " exception was caught-" + exception16.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("CheckBoxList.RepeatLayout"); try { CheckBoxList list4 = new CheckBoxList(); list4.ID = "objCheckBoxListRepeatLayout"; base.GHTActiveForm.Controls.Add(list4); if (!this.Page.IsPostBack) { list4.RepeatLayout = RepeatLayout.Table; } else { this.GHTSubTestAddResult(((int) list4.RepeatLayout).ToString()); } } catch (Exception exception65) { // ProjectData.SetProjectError(exception65); Exception exception17 = exception65; this.GHTSubTestAddResult("Unxpected " + exception17.GetType().Name + " exception was caught-" + exception17.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); TextBox box1 = new TextBox(); box1.ID = "objControlToValidate"; base.GHTActiveForm.Controls.Add(box1); this.GHTSubTestBegin("CompareValidator.Operator"); try { CompareValidator validator1 = new CompareValidator(); validator1.ID = "objCompareValidatorOperator"; validator1.ControlToValidate = "objControlToValidate"; base.GHTActiveForm.Controls.Add(validator1); if (!this.Page.IsPostBack) { validator1.Operator = ValidationCompareOperator.GreaterThan; } else { this.GHTSubTestAddResult(((int) validator1.Operator).ToString()); } } catch (Exception exception66) { // ProjectData.SetProjectError(exception66); Exception exception18 = exception66; this.GHTSubTestAddResult("Unxpected " + exception18.GetType().Name + " exception was caught-" + exception18.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("CompareValidator.ControlToCompare"); try { CompareValidator validator2 = new CompareValidator(); validator2.ID = "objCompareValidatorControlToCompare"; validator2.ControlToValidate = "objControlToValidate"; base.GHTActiveForm.Controls.Add(validator2); if (!this.Page.IsPostBack) { validator2.ControlToValidate = "objControlToValidate"; } else { this.GHTSubTestAddResult(validator2.ControlToValidate); } } catch (Exception exception67) { // ProjectData.SetProjectError(exception67); Exception exception19 = exception67; this.GHTSubTestAddResult("Unxpected " + exception19.GetType().Name + " exception was caught-" + exception19.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("CompareValidator.ValueToCompare"); try { CompareValidator validator3 = new CompareValidator(); validator3.ID = "objCompareValidatorValueToCompare"; validator3.ControlToValidate = "objControlToValidate"; base.GHTActiveForm.Controls.Add(validator3); if (!this.Page.IsPostBack) { validator3.ValueToCompare = "test"; } else { this.GHTSubTestAddResult(validator3.ValueToCompare); } } catch (Exception exception68) { // ProjectData.SetProjectError(exception68); Exception exception20 = exception68; this.GHTSubTestAddResult("Unxpected " + exception20.GetType().Name + " exception was caught-" + exception20.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("HtmlButton.CausesValidation"); try { HtmlButton button4 = new HtmlButton(); button4.ID = "objHtmlButtonCausesValidation"; base.GHTActiveForm.Controls.Add(button4); if (!this.Page.IsPostBack) { button4.CausesValidation = true; } else { this.GHTSubTestAddResult(button4.CausesValidation.ToString()); } } catch (Exception exception69) { // ProjectData.SetProjectError(exception69); Exception exception21 = exception69; this.GHTSubTestAddResult("Unxpected " + exception21.GetType().Name + " exception was caught-" + exception21.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("HtmlInputImage.CausesValidation"); try { HtmlInputImage image1 = new HtmlInputImage(); image1.ID = "objHtmlInputImageCausesValidation"; base.GHTActiveForm.Controls.Add(image1); if (!this.Page.IsPostBack) { image1.CausesValidation = true; } else { this.GHTSubTestAddResult(image1.CausesValidation.ToString()); } } catch (Exception exception70) { // ProjectData.SetProjectError(exception70); Exception exception22 = exception70; this.GHTSubTestAddResult("Unxpected " + exception22.GetType().Name + " exception was caught-" + exception22.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("HtmlInputButton.CausesValidation"); try { HtmlInputButton button5 = new HtmlInputButton(); button5.ID = "objHtmlInputButtonCausesValidation"; base.GHTActiveForm.Controls.Add(button5); if (!this.Page.IsPostBack) { button5.CausesValidation = true; } else { this.GHTSubTestAddResult(button5.CausesValidation.ToString()); } } catch (Exception exception71) { // ProjectData.SetProjectError(exception71); Exception exception23 = exception71; this.GHTSubTestAddResult("Unxpected " + exception23.GetType().Name + " exception was caught-" + exception23.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("HyperLink.Text"); try { HyperLink link1 = new HyperLink(); link1.ID = "objHyperLinkText"; base.GHTActiveForm.Controls.Add(link1); if (!this.Page.IsPostBack) { link1.Text = "test"; } else { this.GHTSubTestAddResult(link1.Text); } } catch (Exception exception72) { // ProjectData.SetProjectError(exception72); Exception exception24 = exception72; this.GHTSubTestAddResult("Unxpected " + exception24.GetType().Name + " exception was caught-" + exception24.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("HyperLink.Target"); try { HyperLink link2 = new HyperLink(); link2.ID = "objHyperLinkTarget"; base.GHTActiveForm.Controls.Add(link2); if (!this.Page.IsPostBack) { link2.Target = "_blank"; } else { this.GHTSubTestAddResult(link2.Target); } } catch (Exception exception73) { // ProjectData.SetProjectError(exception73); Exception exception25 = exception73; this.GHTSubTestAddResult("Unxpected " + exception25.GetType().Name + " exception was caught-" + exception25.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("HyperLink.ImageUrl"); try { HyperLink link3 = new HyperLink(); link3.ID = "objHyperLinkImageUrl"; base.GHTActiveForm.Controls.Add(link3); if (!this.Page.IsPostBack) { link3.ImageUrl = "test"; } else { this.GHTSubTestAddResult(link3.ImageUrl); } } catch (Exception exception74) { // ProjectData.SetProjectError(exception74); Exception exception26 = exception74; this.GHTSubTestAddResult("Unxpected " + exception26.GetType().Name + " exception was caught-" + exception26.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("HyperLink.NavigateUrl"); try { HyperLink link4 = new HyperLink(); link4.ID = "objHyperLinkNavigateUrl"; base.GHTActiveForm.Controls.Add(link4); if (!this.Page.IsPostBack) { link4.NavigateUrl = "test"; } else { this.GHTSubTestAddResult(link4.NavigateUrl); } } catch (Exception exception75) { // ProjectData.SetProjectError(exception75); Exception exception27 = exception75; this.GHTSubTestAddResult("Unxpected " + exception27.GetType().Name + " exception was caught-" + exception27.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("Image.AlternateText"); try { Image image2 = new Image(); image2.ID = "objImageAlternateText"; base.GHTActiveForm.Controls.Add(image2); if (!this.Page.IsPostBack) { image2.AlternateText = "test"; } else { this.GHTSubTestAddResult(image2.AlternateText); } } catch (Exception exception76) { // ProjectData.SetProjectError(exception76); Exception exception28 = exception76; this.GHTSubTestAddResult("Unxpected " + exception28.GetType().Name + " exception was caught-" + exception28.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("Image.ImageAlign"); try { Image image3 = new Image(); image3.ID = "objImageImageAlign"; base.GHTActiveForm.Controls.Add(image3); if (!this.Page.IsPostBack) { image3.ImageAlign = ImageAlign.Right; } else { this.GHTSubTestAddResult(((int) image3.ImageAlign).ToString()); } } catch (Exception exception77) { // ProjectData.SetProjectError(exception77); Exception exception29 = exception77; this.GHTSubTestAddResult("Unxpected " + exception29.GetType().Name + " exception was caught-" + exception29.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("Image.ImageUrl"); try { Image image4 = new Image(); image4.ID = "objImageImageUrl"; base.GHTActiveForm.Controls.Add(image4); if (!this.Page.IsPostBack) { image4.ImageUrl = "test"; } else { this.GHTSubTestAddResult(image4.ImageUrl); } } catch (Exception exception78) { // ProjectData.SetProjectError(exception78); Exception exception30 = exception78; this.GHTSubTestAddResult("Unxpected " + exception30.GetType().Name + " exception was caught-" + exception30.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("ImageButton.CommandName"); try { ImageButton button6 = new ImageButton(); button6.ID = "objImageButtonCommandName"; base.GHTActiveForm.Controls.Add(button6); if (!this.Page.IsPostBack) { button6.CommandName = "test"; } else { this.GHTSubTestAddResult(button6.CommandName); } } catch (Exception exception79) { // ProjectData.SetProjectError(exception79); Exception exception31 = exception79; this.GHTSubTestAddResult("Unxpected " + exception31.GetType().Name + " exception was caught-" + exception31.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("ImageButton.CommandArgument"); try { ImageButton button7 = new ImageButton(); button7.ID = "objImageButtonCommandArgument"; base.GHTActiveForm.Controls.Add(button7); if (!this.Page.IsPostBack) { button7.CommandArgument = "test"; } else { this.GHTSubTestAddResult(button7.CommandArgument); } } catch (Exception exception80) { // ProjectData.SetProjectError(exception80); Exception exception32 = exception80; this.GHTSubTestAddResult("Unxpected " + exception32.GetType().Name + " exception was caught-" + exception32.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("ImageButton.CommandName"); try { ImageButton button8 = new ImageButton(); button8.ID = "objImageButtonCausesValidation"; base.GHTActiveForm.Controls.Add(button8); if (!this.Page.IsPostBack) { button8.CausesValidation = true; } else { this.GHTSubTestAddResult(button8.CausesValidation.ToString()); } } catch (Exception exception81) { // ProjectData.SetProjectError(exception81); Exception exception33 = exception81; this.GHTSubTestAddResult("Unxpected " + exception33.GetType().Name + " exception was caught-" + exception33.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("Label.Text"); try { Label label2 = new Label(); label2.ID = "objLabelText"; base.GHTActiveForm.Controls.Add(label2); if (!this.Page.IsPostBack) { label2.Text = "test"; } else { this.GHTSubTestAddResult(label2.Text); } } catch (Exception exception82) { // ProjectData.SetProjectError(exception82); Exception exception34 = exception82; this.GHTSubTestAddResult("Unxpected " + exception34.GetType().Name + " exception was caught-" + exception34.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("LinkButton.CausesValidation"); try { LinkButton button9 = new LinkButton(); button9.ID = "objLinkButtonCausesValidation"; base.GHTActiveForm.Controls.Add(button9); if (!this.Page.IsPostBack) { button9.CausesValidation = true; } else { this.GHTSubTestAddResult(button9.CausesValidation.ToString()); } } catch (Exception exception83) { // ProjectData.SetProjectError(exception83); Exception exception35 = exception83; this.GHTSubTestAddResult("Unxpected " + exception35.GetType().Name + " exception was caught-" + exception35.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("LinkButton.CommandName"); try { LinkButton button10 = new LinkButton(); button10.ID = "objLinkButtonCommandName"; base.GHTActiveForm.Controls.Add(button10); if (!this.Page.IsPostBack) { button10.CommandName = "test"; } else { this.GHTSubTestAddResult(button10.CommandName); } } catch (Exception exception84) { // ProjectData.SetProjectError(exception84); Exception exception36 = exception84; this.GHTSubTestAddResult("Unxpected " + exception36.GetType().Name + " exception was caught-" + exception36.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("LinkButton.CommandArgument"); try { LinkButton button11 = new LinkButton(); button11.ID = "objLinkButtonCommandArgument"; base.GHTActiveForm.Controls.Add(button11); if (!this.Page.IsPostBack) { button11.CommandArgument = "test"; } else { this.GHTSubTestAddResult(button11.CommandArgument); } } catch (Exception exception85) { // ProjectData.SetProjectError(exception85); Exception exception37 = exception85; this.GHTSubTestAddResult("Unxpected " + exception37.GetType().Name + " exception was caught-" + exception37.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("LinkButton.Text"); try { LinkButton button12 = new LinkButton(); button12.ID = "objLinkButtonText"; base.GHTActiveForm.Controls.Add(button12); if (!this.Page.IsPostBack) { button12.Text = "test"; } else { this.GHTSubTestAddResult(button12.Text); } } catch (Exception exception86) { // ProjectData.SetProjectError(exception86); Exception exception38 = exception86; this.GHTSubTestAddResult("Unxpected " + exception38.GetType().Name + " exception was caught-" + exception38.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("ListBox.All"); try { ListBox box3 = new ListBox(); box3.ID = "objListBoxAll"; base.GHTActiveForm.Controls.Add(box3); if (!this.Page.IsPostBack) { box3.SelectionMode = ListSelectionMode.Multiple; box3.Rows = 2; } else { this.GHTSubTestAddResult(((int) box3.SelectionMode).ToString()); this.GHTSubTestAddResult(box3.Rows.ToString()); } } catch (Exception exception87) { // ProjectData.SetProjectError(exception87); Exception exception39 = exception87; this.GHTSubTestAddResult("Unxpected " + exception39.GetType().Name + " exception was caught-" + exception39.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("ListControl.All"); try { ListBox box4 = new ListBox(); box4.ID = "objListControlAll"; box4.DataSource = this.CreateDataSource(); box4.DataBind(); base.GHTActiveForm.Controls.Add(box4); if (!this.Page.IsPostBack) { box4.AutoPostBack = true; box4.DataMember = "test"; box4.DataTextField = "StringValue"; box4.DataTextFormatString = "{0:C}"; box4.DataValueField = "StringValue"; } else { this.GHTSubTestAddResult(box4.AutoPostBack.ToString()); this.GHTSubTestAddResult(box4.DataMember); this.GHTSubTestAddResult(box4.DataTextField); this.GHTSubTestAddResult(box4.DataTextFormatString); this.GHTSubTestAddResult(box4.DataValueField); } } catch (Exception exception88) { // ProjectData.SetProjectError(exception88); Exception exception40 = exception88; this.GHTSubTestAddResult("Unxpected " + exception40.GetType().Name + " exception was caught-" + exception40.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("Literal.Text"); try { Literal literal1 = new Literal(); literal1.ID = "objLiteralText"; base.GHTActiveForm.Controls.Add(literal1); if (!this.Page.IsPostBack) { literal1.Text = "test"; } else { this.GHTSubTestAddResult(literal1.Text); } } catch (Exception exception89) { // ProjectData.SetProjectError(exception89); Exception exception41 = exception89; this.GHTSubTestAddResult("Unxpected " + exception41.GetType().Name + " exception was caught-" + exception41.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("Panel.All"); try { Panel panel1 = new Panel(); panel1.ID = "objPanelAll"; base.GHTActiveForm.Controls.Add(panel1); if (!this.Page.IsPostBack) { panel1.BackImageUrl = "test"; panel1.HorizontalAlign = HorizontalAlign.Right; panel1.Wrap = true; } else { this.GHTSubTestAddResult(panel1.BackImageUrl); this.GHTSubTestAddResult(((int) panel1.HorizontalAlign).ToString()); this.GHTSubTestAddResult(panel1.Wrap.ToString()); } } catch (Exception exception90) { // ProjectData.SetProjectError(exception90); Exception exception42 = exception90; this.GHTSubTestAddResult("Unxpected " + exception42.GetType().Name + " exception was caught-" + exception42.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("RadioButton.GroupName"); try { RadioButton button13 = new RadioButton(); button13.ID = "objRadioButtonGroupName"; base.GHTActiveForm.Controls.Add(button13); if (!this.Page.IsPostBack) { button13.GroupName = "test"; } else { this.GHTSubTestAddResult(button13.GroupName); } } catch (Exception exception91) { // ProjectData.SetProjectError(exception91); Exception exception43 = exception91; this.GHTSubTestAddResult("Unxpected " + exception43.GetType().Name + " exception was caught-" + exception43.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("RadioButtonList.RepeatColumns"); try { RadioButtonList list5 = new RadioButtonList(); list5.ID = "objRadioButtonListRepeatColumns"; base.GHTActiveForm.Controls.Add(list5); if (!this.Page.IsPostBack) { list5.RepeatColumns = 2; } else { this.GHTSubTestAddResult(list5.RepeatColumns.ToString()); } } catch (Exception exception92) { // ProjectData.SetProjectError(exception92); Exception exception44 = exception92; this.GHTSubTestAddResult("Unxpected " + exception44.GetType().Name + " exception was caught-" + exception44.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("RadioButtonList.RepeatDirection"); try { RadioButtonList list6 = new RadioButtonList(); list6.ID = "objRadioButtonListRepeatDirection"; base.GHTActiveForm.Controls.Add(list6); if (!this.Page.IsPostBack) { list6.RepeatDirection = RepeatDirection.Horizontal; } else { this.GHTSubTestAddResult(((int) list6.RepeatDirection).ToString()); } } catch (Exception exception93) { // ProjectData.SetProjectError(exception93); Exception exception45 = exception93; this.GHTSubTestAddResult("Unxpected " + exception45.GetType().Name + " exception was caught-" + exception45.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("RadioButtonList.TextAlign"); try { RadioButtonList list7 = new RadioButtonList(); list7.ID = "objRadioButtonListTextAlign"; base.GHTActiveForm.Controls.Add(list7); if (!this.Page.IsPostBack) { list7.TextAlign = TextAlign.Right; } else { this.GHTSubTestAddResult(((int) list7.TextAlign).ToString()); } } catch (Exception exception94) { // ProjectData.SetProjectError(exception94); Exception exception46 = exception94; this.GHTSubTestAddResult("Unxpected " + exception46.GetType().Name + " exception was caught-" + exception46.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("RadioButtonList.RepeatLayout"); try { RadioButtonList list8 = new RadioButtonList(); list8.ID = "objRadioButtonListRepeatLayout"; base.GHTActiveForm.Controls.Add(list8); if (!this.Page.IsPostBack) { list8.RepeatLayout = RepeatLayout.Flow; } else { this.GHTSubTestAddResult(((int) list8.RepeatLayout).ToString()); } } catch (Exception exception95) { // ProjectData.SetProjectError(exception95); Exception exception47 = exception95; this.GHTSubTestAddResult("Unxpected " + exception47.GetType().Name + " exception was caught-" + exception47.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTSubTestBegin("TextBox.ReadOnly,AutoPostBack,Columns,Wrap,Text,Rows,MaxLength,TextMode"); try { TextBox box5 = new TextBox(); box5.ID = "objTextBoxAll"; base.GHTActiveForm.Controls.Add(box5); if (!this.Page.IsPostBack) { box5.ReadOnly = true; box5.AutoPostBack = true; box5.Columns = 2; box5.Wrap = true; box5.Text = "test"; box5.Rows = 2; box5.MaxLength = 10; box5.TextMode = TextBoxMode.MultiLine; } else { this.GHTSubTestAddResult(box5.ReadOnly.ToString()); this.GHTSubTestAddResult(box5.ReadOnly.ToString()); this.GHTSubTestAddResult(box5.AutoPostBack.ToString()); this.GHTSubTestAddResult(box5.Columns.ToString()); this.GHTSubTestAddResult(box5.Wrap.ToString()); this.GHTSubTestAddResult(box5.Text); this.GHTSubTestAddResult(box5.Rows.ToString()); this.GHTSubTestAddResult(box5.MaxLength.ToString()); this.GHTSubTestAddResult(((int) box5.TextMode).ToString()); } } catch (Exception exception96) { // ProjectData.SetProjectError(exception96); Exception exception48 = exception96; this.GHTSubTestAddResult("Unxpected " + exception48.GetType().Name + " exception was caught-" + exception48.Message); // ProjectData.ClearProjectError(); } this.GHTSubTestEnd(); this.GHTTestEnd(); }
private DataGridColumn c_hyper_link(ListItemType tp, string text) { HyperLinkColumn column1 = new HyperLinkColumn(); column1.DataTextField = "ID"; column1.NavigateUrl = "http://www.google.com"; this.setStyle(column1, tp); this.setText(column1, tp, text); return column1; }
public override DataGridColumnsPage.ColumnItem CreateColumn() { HyperLinkColumn runtimeColumn = new HyperLinkColumn(); DataGridColumnsPage.ColumnItem item = new DataGridColumnsPage.HyperLinkColumnItem(runtimeColumn) { Text = this.hyperLinkText }; item.LoadColumnInfo(); return item; }
public static void AppendGridColumns(string sGRID_NAME, DataGrid grd) { if ( grd == null ) { SplendidError.SystemWarning(new StackTrace(true).GetFrame(0), "DataGrid is not defined for " + sGRID_NAME); return; } DataTable dt = SplendidCache.GridViewColumns(sGRID_NAME); if ( dt != null ) { // 01/01/2008 Paul. Pull config flag outside the loop. bool bEnableTeamManagement = Crm.Config.enable_team_management(); foreach(DataRow row in dt.Rows) { int nCOLUMN_INDEX = Sql.ToInteger(row["COLUMN_INDEX" ]); string sCOLUMN_TYPE = Sql.ToString (row["COLUMN_TYPE" ]); string sHEADER_TEXT = Sql.ToString (row["HEADER_TEXT" ]); string sSORT_EXPRESSION = Sql.ToString (row["SORT_EXPRESSION" ]); string sITEMSTYLE_WIDTH = Sql.ToString (row["ITEMSTYLE_WIDTH" ]); string sITEMSTYLE_CSSCLASS = Sql.ToString (row["ITEMSTYLE_CSSCLASS" ]); string sITEMSTYLE_HORIZONTAL_ALIGN = Sql.ToString (row["ITEMSTYLE_HORIZONTAL_ALIGN"]); string sITEMSTYLE_VERTICAL_ALIGN = Sql.ToString (row["ITEMSTYLE_VERTICAL_ALIGN" ]); bool bITEMSTYLE_WRAP = Sql.ToBoolean(row["ITEMSTYLE_WRAP" ]); string sDATA_FIELD = Sql.ToString (row["DATA_FIELD" ]); string sDATA_FORMAT = Sql.ToString (row["DATA_FORMAT" ]); string sURL_FIELD = Sql.ToString (row["URL_FIELD" ]); string sURL_FORMAT = Sql.ToString (row["URL_FORMAT" ]); string sURL_TARGET = Sql.ToString (row["URL_TARGET" ]); string sLIST_NAME = Sql.ToString (row["LIST_NAME" ]); // 04/28/2006 Paul. The module is necessary in order to determine if a user has access. string sURL_MODULE = Sql.ToString (row["URL_MODULE" ]); // 05/02/2006 Paul. The assigned user id is necessary if the user only has Owner access. string sURL_ASSIGNED_FIELD = Sql.ToString (row["URL_ASSIGNED_FIELD" ]); HorizontalAlign eHorizontalAlign = HorizontalAlign.NotSet; switch ( sITEMSTYLE_HORIZONTAL_ALIGN.ToLower() ) { case "left" : eHorizontalAlign = HorizontalAlign.Left ; break; case "right": eHorizontalAlign = HorizontalAlign.Right; break; } VerticalAlign eVerticalAlign = VerticalAlign.NotSet; switch ( sITEMSTYLE_VERTICAL_ALIGN.ToLower() ) { case "top" : eVerticalAlign = VerticalAlign.Top ; break; case "middle": eVerticalAlign = VerticalAlign.Middle; break; case "bottom": eVerticalAlign = VerticalAlign.Bottom; break; } // 11/28/2005 Paul. Wrap defaults to true. if ( row["ITEMSTYLE_WRAP"] == DBNull.Value ) bITEMSTYLE_WRAP = true; DataGridColumn col = null; // 02/03/2006 Paul. Date and Currency must always be handled by CreateItemTemplateLiteral. // Otherwise, the date or time will not get properly translated to the correct timezone. // This bug was reported by David Williams. if ( String.Compare(sCOLUMN_TYPE, "BoundColumn", true) == 0 && ( String.Compare(sDATA_FORMAT, "Date" , true) == 0 || String.Compare(sDATA_FORMAT, "DateTime", true) == 0 || String.Compare(sDATA_FORMAT, "Currency", true) == 0 || String.Compare(sDATA_FORMAT, "Image" , true) == 0 ) ) { sCOLUMN_TYPE = "TemplateColumn"; } if ( String.Compare(sCOLUMN_TYPE, "BoundColumn", true) == 0 ) { if ( Sql.IsEmptyString(sLIST_NAME) ) { // GRID_NAME, COLUMN_ORDER, COLUMN_TYPE, HEADER_TEXT, DATA_FIELD, SORT_EXPRESSION, ITEMSTYLE_WIDTH BoundColumn bnd = new BoundColumn(); bnd.HeaderText = sHEADER_TEXT ; bnd.DataField = sDATA_FIELD ; bnd.SortExpression = sSORT_EXPRESSION ; bnd.ItemStyle.Width = new Unit(sITEMSTYLE_WIDTH); bnd.ItemStyle.CssClass = sITEMSTYLE_CSSCLASS; bnd.ItemStyle.HorizontalAlign = eHorizontalAlign ; bnd.ItemStyle.VerticalAlign = eVerticalAlign ; bnd.ItemStyle.Wrap = bITEMSTYLE_WRAP ; // 04/13/2007 Paul. Align the headers to match the data. bnd.HeaderStyle.HorizontalAlign = eHorizontalAlign ; col = bnd; } else { // GRID_NAME, COLUMN_ORDER, COLUMN_TYPE, HEADER_TEXT, DATA_FIELD, SORT_EXPRESSION, ITEMSTYLE_WIDTH TemplateColumn tpl = new TemplateColumn(); tpl.HeaderText = sHEADER_TEXT ; tpl.SortExpression = sSORT_EXPRESSION ; tpl.ItemStyle.Width = new Unit(sITEMSTYLE_WIDTH); tpl.ItemStyle.CssClass = sITEMSTYLE_CSSCLASS; tpl.ItemStyle.HorizontalAlign = eHorizontalAlign ; tpl.ItemStyle.VerticalAlign = eVerticalAlign ; tpl.ItemStyle.Wrap = bITEMSTYLE_WRAP ; // 04/13/2007 Paul. Align the headers to match the data. tpl.HeaderStyle.HorizontalAlign = eHorizontalAlign ; tpl.ItemTemplate = new CreateItemTemplateLiteralList(sDATA_FIELD, sLIST_NAME); col = tpl; } } else if ( String.Compare(sCOLUMN_TYPE, "TemplateColumn", true) == 0 ) { // GRID_NAME, COLUMN_ORDER, COLUMN_TYPE, HEADER_TEXT, DATA_FIELD, SORT_EXPRESSION, ITEMSTYLE_WIDTH TemplateColumn tpl = new TemplateColumn(); tpl.HeaderText = sHEADER_TEXT ; tpl.SortExpression = sSORT_EXPRESSION ; tpl.ItemStyle.Width = new Unit(sITEMSTYLE_WIDTH); tpl.ItemStyle.CssClass = sITEMSTYLE_CSSCLASS; tpl.ItemStyle.HorizontalAlign = eHorizontalAlign ; tpl.ItemStyle.VerticalAlign = eVerticalAlign ; tpl.ItemStyle.Wrap = bITEMSTYLE_WRAP ; // 04/13/2007 Paul. Align the headers to match the data. tpl.HeaderStyle.HorizontalAlign = eHorizontalAlign ; if ( String.Compare(sDATA_FORMAT, "HyperLink", true) == 0 ) { // 07/26/2007 Paul. PopupViews have special requirements. They need an OnClick action that takes more than one parameter. if ( sURL_FIELD.IndexOf(' ') >= 0 ) tpl.ItemTemplate = new CreateItemTemplateHyperLinkOnClick(sDATA_FIELD, sURL_FIELD, sURL_FORMAT, sURL_TARGET, sITEMSTYLE_CSSCLASS, sURL_MODULE, sURL_ASSIGNED_FIELD); else tpl.ItemTemplate = new CreateItemTemplateHyperLink(sDATA_FIELD, sURL_FIELD, sURL_FORMAT, sURL_TARGET, sITEMSTYLE_CSSCLASS, sURL_MODULE, sURL_ASSIGNED_FIELD); } else if ( String.Compare(sDATA_FORMAT, "Image", true) == 0 ) { tpl.ItemTemplate = new CreateItemTemplateImage(sDATA_FIELD, sITEMSTYLE_CSSCLASS); } else { tpl.ItemStyle.CssClass = sITEMSTYLE_CSSCLASS; tpl.ItemTemplate = new CreateItemTemplateLiteral(sDATA_FIELD, sDATA_FORMAT); } col = tpl; } else if ( String.Compare(sCOLUMN_TYPE, "HyperLinkColumn", true) == 0 ) { // GRID_NAME, COLUMN_ORDER, COLUMN_TYPE, HEADER_TEXT, DATA_FIELD, SORT_EXPRESSION, ITEMSTYLE_WIDTH, ITEMSTYLE-CSSCLASS, URL_FIELD, URL_FORMAT HyperLinkColumn lnk = new HyperLinkColumn(); lnk.HeaderText = sHEADER_TEXT ; lnk.DataTextField = sDATA_FIELD ; lnk.SortExpression = sSORT_EXPRESSION ; lnk.DataNavigateUrlField = sURL_FIELD ; lnk.DataNavigateUrlFormatString = sURL_FORMAT ; lnk.Target = sURL_TARGET ; lnk.ItemStyle.Width = new Unit(sITEMSTYLE_WIDTH); lnk.ItemStyle.CssClass = sITEMSTYLE_CSSCLASS; lnk.ItemStyle.HorizontalAlign = eHorizontalAlign ; lnk.ItemStyle.VerticalAlign = eVerticalAlign ; lnk.ItemStyle.Wrap = bITEMSTYLE_WRAP ; // 04/13/2007 Paul. Align the headers to match the data. lnk.HeaderStyle.HorizontalAlign = eHorizontalAlign ; col = lnk; } if ( col != null ) { // 11/25/2006 Paul. If Team Management has been disabled, then hide the column. // Keep the column, but hide it so that the remaining column positions will still be valid. // 10/27/2007 Paul. The data field was changed to TEAM_NAME on 11/25/2006. It should have been changed here as well. if ( sDATA_FIELD == "TEAM_NAME" && !bEnableTeamManagement ) { col.Visible = false; } // 11/28/2005 Paul. In case the column specified is too high, just append column. if ( nCOLUMN_INDEX >= grd.Columns.Count ) grd.Columns.Add(col); else grd.Columns.AddAt(nCOLUMN_INDEX, col); } } } }