Im having trouble adding a client side event as an attribute to the RadRating through the code behind. The RadRating is in a GridEditForm within a Grid so I'm having trouble "finding" controls when I try to do the javascript through the ASPX page.
Below is an example of my attempt. As you see I am trying to add a simple alert to the onclientrated event. When tracing the code, it doesn't seem to add the attribute. If you have a different solution to help me find controls within the Radgrid Editforms, please let me know.
Thanks Kellie
Below is an example of my attempt. As you see I am trying to add a simple alert to the onclientrated event. When tracing the code, it doesn't seem to add the attribute. If you have a different solution to help me find controls within the Radgrid Editforms, please let me know.
Thanks Kellie
protected void RadGridAssetExtrasCondition_ItemDataBound(object sender, GridItemEventArgs e) { switch (e.Item.OwnerTableView.Name) { case "AssetExtrasCondition": if (e.Item is GridCommandItem) { Do some stuff here } if (e.Item is GridDataItem) { Do some stuff here } if ((e.Item is GridEditFormItem || e.Item is GridEditFormInsertItem) && e.Item.IsInEditMode) { var ctrlLabelConditionRatingDescription = (Label)e.Item.FindControl("LabelConditionRatingDescription"); var ctrlRadRatingCondition = (RadRating)e.Item.FindControl("RadRatingCondition"); // Creating the Rad Rating stars dynamically foreach (var item in this.ConditionRatings.Items) { var ratingItem = new RadRatingItem { Value = Convert.ToDecimal(item.Rating), ToolTip = item.Rating.ToString() }; ctrlRadRatingCondition.Items.Add(ratingItem); } ctrlRadRatingCondition.Attributes.Add("onclientrated", "alert('hello');"); if (!e.Item.OwnerTableView.IsItemInserted) { Do some stuff here } } break; } }