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; }
private int GetPropertyIndex(ReportingProperty prop) { for (int i = 0; i < PropertyArray.Length; i++) if (PropertyArray[i] == prop) return i + 1; return 1; }
private string GetSortStr(ReportingProperty prop, EkEnumeration.OrderByDirection order) { string s = GetPropertyIndex(prop).ToString(); if (order == EkEnumeration.OrderByDirection.Descending) s += "-"; return s; }
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; }