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

Hierarchical RadGrid HeaderText Problem

1 Answer 19 Views
Grid
This is a migrated thread and some comments may be shown as answers.
VIJAY
Top achievements
Rank 1
VIJAY asked on 17 May 2012, 02:24 PM

I want to read the Header text of child grid and then use it in displaying alert for specific row.
Below is my codeBehind Code:

Telerik.Web.UI.GridColumn col = null;
            col = rgdLabTest.MasterTableView.DetailTables[0].Columns.FindByUniqueNameSafe("StartAge");
            if (col != null)
            {
                StartAgeCaption = col.HeaderText;
            }

         And in javascript i am using:
if (document.getElementById(id) != null && document.getElementById(id).value == "") {
                    var control = $("#" + id + "_text");
                    var message = '<%=BariAnalyticsEHR.Utility.ContentFetcher.GetValidationMessage("MANDATORY_1", BariAnalyticsEHR.BOL.Classes.EHRSessions.Culture)%>';
                    jAlert(message.replace("#caption#", "<%= StartAgeCaption %>"), control[0].id, null, function (r) {
                        if (r == true) {
                            $("#" + control[0].id).focus();
                        }
                    });
                    return false;
                }

StartAgeCaption value is assigend successfully in the codebehind but in javascript i am not getting that value. Its empty.

1 Answer, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 22 May 2012, 08:31 AM
Hello VIJAY,

What is StartAgeCaption? Is it a hiddenField? If you use ajax in your page make sure that the StartAgeCaption is located into a update panel or it is set as updated control in the ajax managers settings.

Kind regards,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
VIJAY
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Share this question
or