本文整理汇总了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();
}
示例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();
}