Exemplo n.º 1
0
        protected void rgResult_OnFilterCheckListItemsRequested(object sender, GridFilterCheckListItemsRequestedEventArgs e)
        {
            try
            {
                IGridDataColumn column = (IGridDataColumn)e.Column;
                {
                    string dataField = column.GetActiveDataField();

                    DataView  data     = new DataView(Lista);
                    DataTable selected = data.ToTable(Lista.TableName, true, dataField);
                    e.ListBox.DataSource     = selected;
                    e.ListBox.DataKeyField   = dataField;
                    e.ListBox.DataTextField  = dataField;
                    e.ListBox.DataValueField = dataField;
                    e.ListBox.DataBind();
                }
            }
            catch (Exception ex)
            {
                if (_lstError == null)
                {
                    _lstError = new List <string>();
                }
                _lstError.Add(ex.Message);
                Alerta = _lstError;
            }
        }
Exemplo n.º 2
0
 internal static GridColumnState FromOther(IGridDataColumn other)
 {
     return(new GridColumnState
     {
         Name = other.Name,
         SortDirection = other.SortDirection,
         SortOrder = other.SortOrder,
         FilterText = other.FilterText,
         FilterArgument = other.FilterArgument,
         FilterOperator = other.FilterOperator,
         Sortable = other.Sortable,
         DataType = other.DataType,
         Searchable = other.Searchable,
         Aggregate = other.Aggregate,
     });
 }
Exemplo n.º 3
0
        protected void gvTickets_OnFilterCheckListItemsRequested(object sender, GridFilterCheckListItemsRequestedEventArgs e)
        {
            try
            {
                IGridDataColumn gridDataColumn = e.Column as IGridDataColumn;
                if (gridDataColumn != null)
                {
                    string dataField = gridDataColumn.GetActiveDataField();
                    switch (dataField)
                    {
                    case "IdTicket":
                        e.ListBox.DataSource = Tickets.Select(s => s.IdTicket).Distinct().ToList();
                        e.ListBox.DataBind();
                        break;

                    case "Tipificacion":
                        e.ListBox.DataSource = Tickets.Select(s => s.Tipificacion).Distinct().ToList();
                        e.ListBox.DataBind();
                        break;

                    case "FechaHora":
                        e.ListBox.DataSource = Tickets.Select(s => s.FechaHora).Distinct().ToList();
                        e.ListBox.DataBind();
                        break;

                    case "Estatusticket.Descripcion":
                        e.ListBox.DataSource = Tickets.Select(s => s.EstatusTicket.Descripcion).Distinct().ToList();
                        e.ListBox.DataBind();
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                if (_lstError == null)
                {
                    _lstError = new List <string>();
                }
                _lstError.Add(ex.Message);
                Alerta = _lstError;
            }
        }