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

[Solved] Using a checkbox in a grid?

1 Answer 176 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael H.
Top achievements
Rank 1
Michael H. asked on 28 Sep 2009, 07:48 PM
    I've used them in radgrids before, but now I'm trying to do it with a totally ajax-driven grid and it doesn't work. No matter what technique I use I get this error: "Microsoft JScript runtime error: Sys.InvalidOperationException: Cannot serialize object with cyclic reference within child properties." 
    Why does this happen with checkboxes? I can use text inputs just fine. I've tried the '<telerik:GridClientSelectColumn>', the '<telerik:GridCheckBoxColumn>', I've tried using item template with asp checkboxes and regular html checkboxes, and I've tried all these things in various configurations. I'm both baffled and frustrated. Has anyone else been able to do this, and if so, how?

1 Answer, 1 is accepted

Sort by
0
Michael H.
Top achievements
Rank 1
answered on 28 Sep 2009, 08:17 PM
    Ok, I got it working, by brute force kinda. I created another template column and just stuff a checkbox into it in the 'RowDataBound' function.

        function grdSearchResults_RowDataBound(sender, args) {
            var item = args.get_item();

            var template = new Sys.Preview.UI.Template.getTemplate($get("myTemplate"));
            item.get_cell("TemplateCol").innerHTML = "";
            template.createInstance(item.get_cell("TemplateCol"), args.get_dataItem());

            item.get_cell("ChkBoxCol").innerHTML = '<input type="checkbox" />';
        }

Tags
Grid
Asked by
Michael H.
Top achievements
Rank 1
Answers by
Michael H.
Top achievements
Rank 1
Share this question
or