This is a migrated thread and some comments may be shown as answers.

Grid / Batch / AutogeneratedColumn - Change picker and filter

0 Answers 11 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bouyez
Top achievements
Rank 1
Bouyez asked on 31 Jan 2017, 04:03 PM

Hi,

I got some issue with the autogenerated features :

I generated column dynamically with a StoredProcedure. 

1. Change the default DatePicker of autogenerated DateTimeColumn :

I'm able to change the columnEditor with a customEditor. But here it is already a RadDateTimeColumnEditor, I need to find how change the default picker(datePicker) with a DateTimePicker. 

protected void RadGridEdit_CreateColumnEditor(object sender, Telerik.Web.UI.GridCreateColumnEditorEventArgs e)
       {
           GridBoundColumn col = e.Column as GridBoundColumn;                       
           if (col != null && col.UniqueName!="Item" && Session["DataDef"]!=null)
           {
               DataSet ds = (DataSet)Session["DataDef"];
               DataRow[] drDeff = null;
               if (ds.Tables[0].AsEnumerable().Any(row => col.UniqueName == row.Field<String>("ListColumnNameFr")))
               {
                   drDeff = ds.Tables[0].Select("ListColumnNameFr='" + col.UniqueName + "'");
               }
               else
               {
                   drDeff = ds.Tables[0].Select("ListColumnNameFr='" + (col.UniqueName).Replace(" ", "") + "'");
               }
               if(drDeff.Length == 0) return;
               switch(drDeff[0][4] as string)
               {
                   case "DROPDOWN":
                       e.ColumnEditor = new CustomDropDownListEditor((ds.Tables[1].Select("ColumnKey='" + drDeff[0][1] + "'")).CopyToDataTable());
                       break;
                   default:
                       if (e.ColumnEditor is GridTextBoxColumnEditor)
                       {
                           GridTextBoxColumnEditor txt = e.ColumnEditor as GridTextBoxColumnEditor;
                           txt.TextBoxMode = TextBoxMode.MultiLine;
                       }
                       else if (e.ColumnEditor is GridDateTimeColumnEditor)
                       {                           
                           GridDateTimeColumnEditor gdtce = e.ColumnEditor as GridDateTimeColumnEditor;
                           gdtce.PickerControl.GetType();
                       }
 
                       break;
               }
           }
       }

 

2. Change autogenerated filters :
Where and when can I change it?

 

Thx,

Bouyez.

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Bouyez
Top achievements
Rank 1
Share this question
or