当前位置: 首页>>代码示例>>C#>>正文


C# GridViewRow.Equals方法代码示例

本文整理汇总了C#中System.Web.UI.WebControls.GridViewRow.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# GridViewRow.Equals方法的具体用法?C# GridViewRow.Equals怎么用?C# GridViewRow.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Web.UI.WebControls.GridViewRow的用法示例。


在下文中一共展示了GridViewRow.Equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetRowClass

        private string GetRowClass(GridView gridView, GridViewRow row)
        {
            string className = "";

            if ((row.RowState & DataControlRowState.Alternate) == DataControlRowState.Alternate)
            {
                className += " AspNet-GridView-Alternate ";
                if (gridView.AlternatingRowStyle != null)
                {
                    className += gridView.AlternatingRowStyle.CssClass;
                }
            }
            else if (row.Equals(gridView.HeaderRow) && (gridView.HeaderStyle != null) && (!String.IsNullOrEmpty(gridView.HeaderStyle.CssClass)))
            {
                className += " " + gridView.HeaderStyle.CssClass;
            }
            else if (row.Equals(gridView.FooterRow) && (gridView.FooterStyle != null) && (!String.IsNullOrEmpty(gridView.FooterStyle.CssClass)))
            {
                className += " " + gridView.FooterStyle.CssClass;
            }
            else if ((gridView.RowStyle != null) && (!String.IsNullOrEmpty(gridView.RowStyle.CssClass)))
            {
                className += " " + gridView.RowStyle.CssClass;
            }

            if ((row.RowState & DataControlRowState.Edit) == DataControlRowState.Edit)
            {
                className += " AspNet-GridView-Edit ";
                if (gridView.EditRowStyle != null)
                {
                    className += gridView.EditRowStyle.CssClass;
                }
            }

            if ((row.RowState & DataControlRowState.Insert) == DataControlRowState.Insert)
            {
                className += " AspNet-GridView-Insert ";
            }

            if ((row.RowState & DataControlRowState.Selected) == DataControlRowState.Selected)
            {
                className += " AspNet-GridView-Selected ";
                if (gridView.SelectedRowStyle != null)
                {
                    className += gridView.SelectedRowStyle.CssClass;
                }
            }

            //// EmptyDataTemplate
            if ((row.RowType & DataControlRowType.EmptyDataRow) == DataControlRowType.EmptyDataRow)
            {
                className += " AspNet-GridView-Empty ";
            }

            return className.Trim();
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:56,代码来源:GridViewAdapter.cs

示例2: GetRowClass

        /// <summary>
        /// Gets the row class.
        /// </summary>
        /// <param name="gridView">
        /// The grid view.
        /// </param>
        /// <param name="row">
        /// The row.
        /// </param>
        /// <returns>
        /// The get row class.
        /// </returns>
        /// <remarks>
        /// </remarks>
        private static string GetRowClass(GridView gridView, GridViewRow row)
        {
            var className = string.Empty;

            if ((row.RowState & DataControlRowState.Alternate) == DataControlRowState.Alternate)
            {
                className += " AspNet-GridView-Alternate ";
                className += gridView.AlternatingRowStyle.CssClass;
            }
            else if (row.Equals(gridView.HeaderRow) && (!String.IsNullOrEmpty(gridView.HeaderStyle.CssClass)))
            {
                className += " " + gridView.HeaderStyle.CssClass;
            }
            else if (row.Equals(gridView.FooterRow) && (!String.IsNullOrEmpty(gridView.FooterStyle.CssClass)))
            {
                className += " " + gridView.FooterStyle.CssClass;
            }
            else if (!String.IsNullOrEmpty(gridView.RowStyle.CssClass))
            {
                className += " " + gridView.RowStyle.CssClass;
            }

            if ((row.RowState & DataControlRowState.Edit) == DataControlRowState.Edit)
            {
                className += " AspNet-GridView-Edit ";
                className += gridView.EditRowStyle.CssClass;
            }

            if ((row.RowState & DataControlRowState.Insert) == DataControlRowState.Insert)
            {
                className += " AspNet-GridView-Insert ";
            }

            if ((row.RowState & DataControlRowState.Selected) == DataControlRowState.Selected)
            {
                className += " AspNet-GridView-Selected ";
                className += gridView.SelectedRowStyle.CssClass;
            }

            return className.Trim();
        }
开发者ID:divyang4481,项目名称:appleseedapp,代码行数:55,代码来源:GridViewAdapter.cs


注:本文中的System.Web.UI.WebControls.GridViewRow.Equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。