Beispiel #1
0
        private void SetColumn(GridColumn c)
        {
            IndGridBoundColumn col = c as IndGridBoundColumn;

            if (col != null && col.Display)
            {
                if (col.Cell.Controls.Count > 2)
                {
                    if (col.Cell.Controls[1] is DropDownList)
                    {
                        DropDownList d      = (DropDownList)col.Cell.Controls[1];
                        GridColumn   column = GenericGrid.MasterTableView.GetColumnSafe(col.UniqueName);
                        column.CurrentFilterValue = ((d.SelectedValue == "All") ? String.Empty : d.SelectedValue);
                    }

                    if (col.Cell.Controls[1] is IndDatePicker)
                    {
                        IndDatePicker datePicker = (IndDatePicker)col.Cell.Controls[1];
                        GridColumn    column     = GenericGrid.MasterTableView.GetColumnSafe(col.UniqueName);
                        column.CurrentFilterValue = (datePicker.SelectedDate != null) ? ((DateTime)datePicker.SelectedDate).ToShortDateString() : null;
                    }
                }
                else
                {
                    int ind = -1;
                    if (col.Cell.Controls.Count > 0 && col.Cell.Controls[0] is TextBox)
                    {
                        ind = 0;
                    }
                    else if (col.Cell.Controls.Count > 1 && col.Cell.Controls[1] is TextBox)
                    {
                        ind = 1;
                    }
                    if (ind >= 0)
                    {
                        GridColumn column = GenericGrid.MasterTableView.GetColumnSafe(col.UniqueName);
                        if (column != null)
                        {
                            column.CurrentFilterValue = ((TextBox)col.Cell.Controls[ind]).Text.Trim();
                        }
                    }
                }
            }
        }
Beispiel #2
0
 private bool IsColumnNumeric(IndGridBoundColumn col)
 {
     return(col.DataType == typeof(int) || col.DataType == typeof(decimal));
 }