Hi,
i'm adding validator through the ItemCreated for the datetime column. The grid is giving me
Unable to cast object of type 'System.Web.UI.WebControls.Panel' to type 'System.Web.UI.WebControls.TableCell'.
the following is my c# code.
i'm adding validator through the ItemCreated for the datetime column. The grid is giving me
Unable to cast object of type 'System.Web.UI.WebControls.Panel' to type 'System.Web.UI.WebControls.TableCell'.
the following is my c# code.
GridDateTimeColumnEditor editorStartTime = (GridDateTimeColumnEditor)item.EditManager.GetColumnEditor("StartRunTimeColumn");
cell = (
TableCell)editorStartTime.SharedTimeView.Parent;
RequiredFieldValidator
Validator =
new RequiredFieldValidator();
editorStartTime.SharedTimeView.ID =
"StartRunTimeColumn";
Validator.ControlToValidate = editorStartTime.TextBoxControl.ID;
Validator.BackColor = System.Drawing.
Color.Red;
Validator.ErrorMessage =
"*";
cell.Controls.Add(Validator);