SetSortDirectionImage() public static method

public static SetSortDirectionImage ( GridView gridView, GridViewRow headerRow, string sortExpression, SortDirection, sortDirection ) : void
gridView GridView
headerRow GridViewRow
sortExpression string
sortDirection SortDirection,
return void
Beispiel #1
0
 protected void SparePartsGridView_RowCreated(Object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.Header)
     {
         object sortExpressionObj = ViewState[CarServiceConstants.SORT_EXPRESSION_VIEW_STATE_ATTR];
         object sortDirectionObj  = ViewState[CarServiceConstants.SORT_DIRECTION_VIEW_STATE_ATTR];
         if (sortExpressionObj != null && sortDirectionObj != null)
         {
             SortingUtility.SetSortDirectionImage(this.sparePartsGrid, e.Row, sortExpressionObj.ToString(),
                                                  ((SortDirection)sortDirectionObj));
         }
     }
     else if (e.Row.RowType == DataControlRowType.DataRow)
     {
         object isApprovedObject = DataBinder.Eval(e.Row.DataItem, "IsActive");
         if (isApprovedObject != null)
         {
             bool isApproved = (bool)isApprovedObject;
             if (isApproved == false)
             {
                 e.Row.CssClass = CarServiceConstants.INACTIVE_CSS_CLASS_NAME;
             }
         }
     }
 }
Beispiel #2
0
        protected void RepairCardsGridView_RowCreated(Object sender, GridViewRowEventArgs e)
        {
            DataControlRowType rowType = e.Row.RowType;

            if (rowType == DataControlRowType.Header)
            {
                object sortExpressionObj = ViewState[CarServiceConstants.SORT_EXPRESSION_VIEW_STATE_ATTR];
                object sortDirectionObj  = ViewState[CarServiceConstants.SORT_DIRECTION_VIEW_STATE_ATTR];
                if (sortExpressionObj != null && sortDirectionObj != null)
                {
                    SortingUtility.SetSortDirectionImage(this.repairCardsGrid, e.Row, sortExpressionObj.ToString(),
                                                         ((SortDirection)sortDirectionObj));
                }
            }
            else if (rowType == DataControlRowType.DataRow)
            {
                object userIdObject = DataBinder.Eval(e.Row.DataItem, CarServiceConstants.USER_ID_SORT_EXPRESSION);
                if (userIdObject != null)
                {
                    MembershipUser currentUser = Membership.GetUser();
                    string         userId      = userIdObject.ToString();
                    if (string.IsNullOrEmpty(userId) == false &&
                        userId.Equals(currentUser.ProviderUserKey.ToString()))
                    {
                        e.Row.CssClass = CarServiceConstants.ACTIVE_CSS_CLASS_NAME;
                    }
                }
            }
        }
Beispiel #3
0
 protected void CarsGridView_RowCreated(Object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.Header)
     {
         object sortExpressionObj = ViewState[CarServiceConstants.SORT_EXPRESSION_VIEW_STATE_ATTR];
         object sortDirectionObj  = ViewState[CarServiceConstants.SORT_DIRECTION_VIEW_STATE_ATTR];
         if (sortExpressionObj != null && sortDirectionObj != null)
         {
             SortingUtility.SetSortDirectionImage(this.automobilesGrid, e.Row, sortExpressionObj.ToString(),
                                                  ((SortDirection)sortDirectionObj));
         }
     }
 }