Exemple #1
0
    protected string GenerateHeaderUrl(ReportingProperty prop)
    {
        ReportingProperty currentProp = SortBy;
        EkEnumeration.OrderByDirection currentOrder = SortOrder;

        EkEnumeration.OrderByDirection newOrder = currentProp == prop ?
            (currentOrder == EkEnumeration.OrderByDirection.Ascending ? EkEnumeration.OrderByDirection.Descending : EkEnumeration.OrderByDirection.Ascending) :
            currentOrder;

        string baseUrl = "window." + this.ClientID + "_Sort('" + GetSortStr(prop, newOrder) + "');return false;";

        return baseUrl;
    }
Exemple #2
0
 private int GetPropertyIndex(ReportingProperty prop)
 {
     for (int i = 0; i < PropertyArray.Length; i++)
         if (PropertyArray[i] == prop)
             return i + 1;
     return 1;
 }
Exemple #3
0
    private string GetSortStr(ReportingProperty prop, EkEnumeration.OrderByDirection order)
    {
        string s = GetPropertyIndex(prop).ToString();

        if (order == EkEnumeration.OrderByDirection.Descending)
            s += "-";

        return s;
    }
Exemple #4
0
    protected string GetSortClass(ReportingProperty prop, string appendClass)
    {
        string cssClass = appendClass + (string.IsNullOrEmpty(appendClass) ? string.Empty : " ");
        if (SortBy == prop)
            cssClass += SortOrder == EkEnumeration.OrderByDirection.Ascending ?
                "hdrSortUp" :
                "hdrSortDown";

        return cssClass;
    }