internal override object GetValue(GridViewRowInfo row, GridViewDataOperation operation) { object cellValue = base.GetValue(row, operation); if (operation == GridViewDataOperation.Sorting && this.displayMemberSort || operation == GridViewDataOperation.Filtering && this.filteringMode == GridViewFilteringMode.DisplayMember) { return(this.GetLookupValue(cellValue)); } return(cellValue); }
internal override object GetValue(GridViewRowInfo row, GridViewDataOperation operation) { object obj = base.GetValue(row, operation); if (operation == GridViewDataOperation.Filtering && !Convert.IsDBNull(obj) && obj != null) { if (this.DataTypeConverter != null && this.DataTypeConverter.CanConvertTo((ITypeDescriptorContext)this, typeof(DateTime))) { obj = this.DataTypeConverter.ConvertTo((ITypeDescriptorContext)this, this.FormatInfo, obj, typeof(DateTime)); } obj = (object)GridViewHelper.ClampDateTime(Convert.ToDateTime(obj), this.filteringMode); } return(obj); }
public static int CompareRows( GridViewRowInfo x, GridViewRowInfo y, SortDescriptorCollection context) { GridViewDataOperation type = GridViewDataOperation.Sorting; for (int index = 0; index < context.Count; ++index) { if (context[index].PropertyIndex >= 0) { GridViewDataColumn column = x.ViewTemplate.Columns[context[index].PropertyIndex]; object xValue = column.GetValue(x, type); object yValue = column.GetValue(y, type); if (column.UseDataTypeConverterWhenSorting && column.DataTypeConverter != null && column.DataTypeConverter.CanConvertTo((ITypeDescriptorContext)column, column.DataType)) { GridViewComboBoxColumn viewComboBoxColumn = column as GridViewComboBoxColumn; if (viewComboBoxColumn == null || !viewComboBoxColumn.DisplayMemberSort) { CultureInfo formatterCulture = GridViewRowInfoComparer.GetFormatterCulture((IFormatProvider)column.FormatInfo); xValue = column.DataTypeConverter.ConvertTo((ITypeDescriptorContext)column, formatterCulture, xValue, column.DataType); yValue = column.DataTypeConverter.ConvertTo((ITypeDescriptorContext)column, formatterCulture, yValue, column.DataType); } } GridViewRowInfoComparer.GetBlobData(ref xValue, ref yValue); int num = !(xValue is IComparable) || yValue == null || (object)yValue.GetType() != (object)xValue.GetType() ? DataUtils.CompareNulls(xValue, yValue) : ((IComparable)xValue).CompareTo(yValue); if (num != 0) { if (context[index].Direction == ListSortDirection.Descending) { return(-num); } return(num); } } } return(0); }
internal virtual object GetValue(GridViewRowInfo row, GridViewDataOperation type) { return(this.accessor[row]); }