7 Answers, 1 is accepted
0
Accepted

Jayesh Goyani
Top achievements
Rank 2
answered on 06 Oct 2011, 01:50 PM
Hello,
let me know if any concern.
Thanks,
Jayesh Goyani
protected
void
rgQueue_ItemCreated(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridEditableItem && e.Item.IsInEditMode)
{
GridEditableItem item = e.Item
as
GridEditableItem;
//Find the cell and the item to validate
GridTextBoxColumnEditor sorteditor = (GridTextBoxColumnEditor)item.EditManager.GetColumnEditor(
"Column1"
);
TableCell cell = (TableCell)sorteditor.TextBoxControl.Parent;
RequiredFieldValidator validator =
new
RequiredFieldValidator();
sorteditor.TextBoxControl.ID =
"ID_for_validation"
;
validator.ControlToValidate = sorteditor.TextBoxControl.ID;
validator.ErrorMessage =
"*Required"
;
validator.ForeColor = Color.Red;
validator.Display = ValidatorDisplay.Dynamic;
cell.Controls.Add(validator);
let me know if any concern.
Thanks,
Jayesh Goyani
0

Adigard
Top achievements
Rank 1
answered on 06 Oct 2011, 02:06 PM
Hello,
It looks to be what i'm looking for but i don't really understand your code... :s
What am i supposed to put instead of Column1
Thank you for your help anyway!
It looks to be what i'm looking for but i don't really understand your code... :s
What am i supposed to put instead of Column1
Thank you for your help anyway!
0

Adigard
Top achievements
Rank 1
answered on 06 Oct 2011, 02:14 PM
No!
I now understand
it is perfectly working!
thanks
I now understand
it is perfectly working!
thanks
0

Adigard
Top achievements
Rank 1
answered on 07 Oct 2011, 09:46 AM
Just a last question :
It is not working for a GridDateTimeColumn. I tried to make some changes but it is not working
do you find the error(s)?
GridDateTimeColumnEditor Debut = (GridDateTimeColumnEditor)item.EditManager.GetColumnEditor("debut");
TableCell CellDebut = (TableCell)Debut.PickerControl.Parent;
RequiredFieldValidator DebutValidator = new RequiredFieldValidator();
Debut.PickerControl.ID = "ID_for_DebutValidator";
DebutValidator.ControlToValidate = Debut.PickerControl.ID;
DebutValidator.ErrorMessage = "*Nécessaire";
DebutValidator.ForeColor = Color.Red;
DebutValidator.Display = ValidatorDisplay.Dynamic;
CellDebut.Controls.Add(DebutValidator);
Thank you in advance!
It is not working for a GridDateTimeColumn. I tried to make some changes but it is not working
do you find the error(s)?
GridDateTimeColumnEditor Debut = (GridDateTimeColumnEditor)item.EditManager.GetColumnEditor("debut");
TableCell CellDebut = (TableCell)Debut.PickerControl.Parent;
RequiredFieldValidator DebutValidator = new RequiredFieldValidator();
Debut.PickerControl.ID = "ID_for_DebutValidator";
DebutValidator.ControlToValidate = Debut.PickerControl.ID;
DebutValidator.ErrorMessage = "*Nécessaire";
DebutValidator.ForeColor = Color.Red;
DebutValidator.Display = ValidatorDisplay.Dynamic;
CellDebut.Controls.Add(DebutValidator);
Thank you in advance!
0

Adigard
Top achievements
Rank 1
answered on 07 Oct 2011, 04:26 PM
Can anyone help me ? :s
0
Accepted

Jayesh Goyani
Top achievements
Rank 2
answered on 07 Oct 2011, 06:16 PM
Hello,
Sorry for late reply,
let me know if any concern.
Thanks,
Jayesh Goyani
Sorry for late reply,
<telerik:GridDateTimeColumn DataField=
"Cdate"
ColumnEditorID=
"Column1"
UniqueName=
"Column1"
>
............
...........
</telerik:RadGrid>
<telerik:GridDateTimeColumnEditor ID=
"Column1"
runat=
"server"
>
</telerik:GridDateTimeColumnEditor>
if
(e.Item
is
GridEditableItem && e.Item.IsInEditMode)
{
GridDateTimeColumnEditor columnEditor =
((GridEditableItem)e.Item).EditManager.GetColumnEditor(
"Column1"
)
as
GridDateTimeColumnEditor;
TableCell cell = (TableCell)columnEditor.PickerControl.Parent;
RequiredFieldValidator validator =
new
RequiredFieldValidator();
validator.ID =
"RequiredFieldValidator1"
;
validator.ControlToValidate = columnEditor.PickerControl.ID;
validator.ErrorMessage =
"*"
;
cell.Controls.Add(validator);
}
let me know if any concern.
Thanks,
Jayesh Goyani
0

Adigard
Top achievements
Rank 1
answered on 10 Oct 2011, 09:34 AM
Thanks a lot !