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

Client side Problem in RadGrid

2 Answers 64 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
AMS asked on 20 Sep 2010, 02:04 PM
I am using the same method for binding data returned from json to the client side.
Please note that i am using this Grid in MVC 1.0. Script Manager and all other telerik objects are loading properly and i am receiving this JSON from a method which returns JSON. I hope that the given code is sufficient, however i can provide you MVC code, if required:
I am using the following code:

            type: "POST",
            url: getAppPath() + "Account.aspx/UsersList",
            data: { State: StateVal, County: CountyVal, District: DistrictVal, School: SchoolVal, sUserName: userName, sUserEmail: email, Status: StatusVal },
            success: function(results) {
            error: function(msg) {
                alert("The following error occurred: " + msg.status + ": " + msg.statusText);


 <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

        <script type="text/javascript">

            function updateGrid(result) {
                var tableView = $find("<%= grdUsers.ClientID %>").get_masterTableView();

            function RadGrid1_Command(sender, args) {
                var a = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
                alert("page command");




When i call the updateGrid method
                var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
the following line returns null. However if i only use this line, it will find the Grid.
var a = $find("<%= RadGrid1.ClientID %>")
Please let me know how to handle it and later assign the json to grid in order to populate it.

2 Answers, 1 is accepted

Sort by
Top achievements
Rank 1
answered on 21 Sep 2010, 12:02 PM
I have gone through this post

if i declare the OnCommand event of grid in order to initialize it like this, i am getting the following error

Control 'ctl00_MainContent_RadGrid1_ctl00_ctl02_ctl01_ctl04' of type 'Button' must be placed inside a form tag with runat=server.

function RadGrid1_Command(sender, args) { } //for initializing grid on client side
 <telerik:RadGrid ID="RadGrid1" runat="server" Skin="Web20" AutoGenerateColumns="false"
            <MasterTableView TableLayout="Fixed">
                    <telerik:GridBoundColumn DataField="Username" HeaderText="User Name" />
                    <telerik:GridBoundColumn DataField="Email" HeaderText="Email" />
                <ClientEvents  OnCommand="RadGrid1_Command" />
Telerik team
answered on 23 Sep 2010, 10:52 AM
Hello Abbid,

To achieve the desired functionality and avoid the described error I suggest you to use the Telerik Grid for ASP.NET MVC instead of RadGrid for ASP.NET Ajax. On the following link you could find the online demos for the ASP.NET MVC grid:

Best wishes,
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Asked by
Top achievements
Rank 1
Answers by
Top achievements
Rank 1
Telerik team
Share this question