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

GridNumericColumn error alert

2 Answers 52 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sampada
Top achievements
Rank 1
Sampada asked on 21 Aug 2012, 06:30 AM
Team,

I wanted to show alert message "Enter only numbers" on error event of GridNumericColumn.
I have implemented it in RadNumericTextBox by 'ClientEvents.OnError = "numericerror"' property.
I wanted to to show same error message on GridNumericColumn data entry.
Please let me know How I can implement it ASAP.

Thanks in advance

Regards,
Sampada

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 21 Aug 2012, 06:44 AM
Hi,

You can access the column in edit mode and show the alert message. Here is the sample code.
C#:
protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
  if (e.Item is GridEditableItem & e.Item.IsInEditMode)
  {
   GridEditableItem EditItem = (GridEditableItem)e.Item;
   RadNumericTextBox txt = (RadNumericTextBox)EditItem["UniqueName"].Controls[0];
   txt.ClientEvents.OnError = "OnError";
  }
}
JS:
function OnError()
{
 alert("Enter only numbers");
}

Thanks,
Shinu.
0
Sampada
Top achievements
Rank 1
answered on 21 Aug 2012, 10:26 AM
Thanks for your quick reply

I have achieved the task.

Regards,
Sampada







Tags
Grid
Asked by
Sampada
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Sampada
Top achievements
Rank 1
Share this question
or