Current filter:
                                You should refresh the page.
                                  • I am using this code:-

                                    [JavaScript]
                                    $('<div class="checkBoxg"/>').dxRadioGroup({ dataSource: [{ text: "Allow", color: "1" }, { text: "Deny", color: "0" }], displayExpr: "text", valueExpr: "color", value: options.data.allowed, layout: 'horizontal', rowKey: options.row.key, showRowLines: true, onValueChanged: function (e) { // alert(allowdeny); var checkBoxes = $(".checkBoxg"); $.each(checkBoxes, function (i, v) { var rg = $(v).dxRadioGroup("instance") if (grid.isRowSelected(rg.option("rowKey"))) rg.option("value", e.value); }); } }).appendTo(container);

                                    options.data.allowed gives me 1 if use alert(options.data.allowed);

                                    I have assign  same thing to value: options.data.allowed,

                                    it does not select radio button
                                    if I use value: "1",  hardcode then it work fine

                                1 Solution

                                Creation Date Importance Sort by

                                Hi Mark,

                                Please take a look at the jQuery - Get and Set Options help topic to learn how to change widget options at runtime. So, your code might be as follows:

                                [JavaScript]
                                var rg = $('<div class="checkBoxg"/>').dxRadioGroup({ dataSource: [{ text: "Allow", color: "1" }, { text: "Deny", color: "0" }], displayExpr: "text", valueExpr: "color", value: options.data.allowed, layout: 'horizontal', rowKey: options.row.key, showRowLines: true, onValueChanged: function (e) { // alert(allowdeny); var checkBoxes = $(".checkBoxg"); $.each(checkBoxes, function (i, v) { var rg = $(v).dxRadioGroup("instance") if (grid.isRowSelected(rg.option("rowKey"))) rg.option("value", e.value); }); } }).appendTo(container); rg.dxRadioGroup("instance").option("value", newValue);
                                • Mark Linton 07.12.2017

                                  It does not work for me

                                  This is my code below:-
                                       var groupstore = new DevExpress.data.ArrayStore({ data: group, key: 'groupId' });
                                              var grid = $("#grouppermission").dxDataGrid({
                                                  onContentReady: function (e) { },
                                                  dataSource: new DevExpress.data.DataSource({ store: groupstore }),
                                                  selection: { mode: 'multiple', showCheckBoxesMode: 'always' },
                                                  showRowLines: true,
                                                  paging: {
                                                      enabled: true,
                                                      pageSize: 2,
                                                  },
                                                  // remoteOperations: false,
                                                  columns: [{ dataField: "groupName", caption: "User" }, "description",
                                                   {
                                                       caption: "Allow / Deny", cellTemplate: function (container, options) {
                                                           var allowdeny = options.data.allowed;
                                                           //alert(allowdeny);
                                                           var rg = $('<div class="checkBoxg"/>').dxRadioGroup({
                                                               dataSource: [{ text: "Allow", color: "1" }, { text: "Deny", color: "0" }],
                                                               displayExpr: "text",
                                                               valueExpr: "color",
                                                               value: options.data.allowed,
                                                               layout: 'horizontal',
                                                               rowKey: options.row.key,
                                                               showRowLines: true,
                                                               onValueChanged: function (e) {
                                                                   // alert(allowdeny);
                                                                   var checkBoxes = $(".checkBoxg");
                                                                   $.each(checkBoxes, function (i, v) {
                                                                       var rg = $(v).dxRadioGroup("instance")
                                                                       if (grid.isRowSelected(rg.option("rowKey")))
                                                                           rg.option("value", e.value);
                                                                   });
                                                               }
                                                           }).appendTo(container);
                                                           rg.dxRadioGroup("instance").option("value", newValue);

                                                       }
                                                   }]

                                              }).dxDataGrid('instance');

                                • Mark Linton 07.12.2017

                                  it work if I use same by value
                                   value: options.data.allowed,  instead of this  value:"1" ;

                                • Mark Linton 07.12.2017

                                  It work I have changed it to string

                                  var allowdeny = options.data.allowed;
                                                           allowdeny = allowdeny.toString();