Skip to content

Replies

0
Svetla Boykova
Svetla Boykova answered on Feb 12, 2019 6:03 AM

Hello Roger,

You can find more information about WebDataGrid Using ItemCommand Event in the following help topic:

WebDataGrid Using ItemCommand Event

Let me know if I may be of further assistance.

Svetla Boykova

0
Svetla Boykova
Svetla Boykova answered on Feb 11, 2019 10:29 AM

Hello Roger,

You can see the following sample that demonstrates the Drop-Down Editors in WebDataGrid here.

You can check this help help topic  as well.

You can find the row the drop-down belongs using SelectionChanged client event as described in that forum post

You can find the row the drop-down belongs using SelectionChanged server event as described in that forum post

Let me know if I may be of further assistance.

Svetla Boykova

0
Svetla Boykova
Svetla Boykova answered on May 28, 2018 12:21 PM

Hello Aravind,

I am glad that you manage to achieve the desired functionality.

Let me know if you have any questions with this matter.


Svetla Boykova

0
Svetla Boykova
Svetla Boykova answered on May 21, 2018 2:36 PM

Hello Aravind,

You can change the state of the checkbox using client side code – _setCheckState using 1 – checked and 0 – unchecked as parameter.

var grid = ig_controls["WebDataGrid1"];
var cell = grid.get_rows().get_row(row_index).get_cellByColumnKey("Checkbox");
var newCheckState = cell._getCheckState() === 1 ? 0 : 1;
cell._setCheckState(newCheckState);

Let me know if you have any questions with this matter.


Svetla Boykova

0
Svetla Boykova
Svetla Boykova answered on May 16, 2018 1:19 PM

Hello Aravind,

About your first question, you can disable a checkbox using CellValueChanging not EnteringEditMode event.   


                       
...

function WebDataGrid1_Editing_CellValueChanging(sender, eventArgs) {
    let currentCell = eventArgs.get_cell();
    if (currentCell.get_column().get_key() == "Checkbox") {
       var index = currentCell.get_row().get_index();
           if (index == "0")
               eventArgs.set_cancel(true);
        }
     }

About your second question, it is best to modify your data source checkbox value.

About your third question, you can disable the editing of the entire column setting it as ReadOnly:

EditingColumnSetting settings = new EditingColumnSetting()
{
    ColumnKey = "Checkbox",
    ReadOnly = true
};
WebDataGrid1.Behaviors.EditingCore.Behaviors.CellEditing.ColumnSettings.Add(settings);

Let me know if you have any questions with this matter.


Svetla Boykova