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

Lost Edit control when using OnBatchEditSetEditorValue

1 Answer 76 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David Stacey
Top achievements
Rank 1
David Stacey asked on 09 Jan 2014, 09:17 AM

I have a radgrid with batch editing and a hidden column to decide if the row can be edited.

On the clientside in the OnBatchEditSetEditorValue I check this column and set the innerHTML if the row cannot be edtied.

The trouble is after clicking on a row which cannot be edited the edit control is no longer available on other rows.

 

function BatchEditSetEditorValue(sender, args) {

    var itemContainer = args.get_container();

    var editorValue = args.get_value();

 

        var readOnlyRow = false;

        if (args.get_row().control.get_dataItem()['readOnlyRow'] != undefined) {

            readOnlyRow = args.get_row().control.get_dataItem()['readOnlyRow']

        }

        if (readOnlyRow) {

            itemContainer.innerHTML = editorValue;

            args.set_cancel(true);

        }

}

 

Is there a better way or another event I could use to stop the cell going into edit mode?

Thankyou.

1 Answer, 1 is accepted

Sort by
0
David Stacey
Top achievements
Rank 1
answered on 09 Jan 2014, 11:21 AM
I was being stupid, missed the
OnBatchEditOpening event which works fine.

function BatchEditOpening(sender, args) {
    var readOnlyRow = false;
    if (args.get_row().control.get_dataItem()['readOnlyRow'] != undefined) {
        readOnlyRow = args.get_row().control.get_dataItem()['readOnlyRow']
    }
    args.set_cancel(readOnlyRow);
}
Tags
Grid
Asked by
David Stacey
Top achievements
Rank 1
Answers by
David Stacey
Top achievements
Rank 1
Share this question
or