Hi there,
I have a gridview that is using batch edit updating.
I read this post:
https://www.devexpress.com/Support/Center/Question/Details/T121689
which says to set the value of a readonly cell, ie:
grid.batchEditApi.SetCellValue(grid.lastMultiSelectIndex, "PRODUCT_COST", cost.toFixed(2));
I need to remove the setting:
EditFormSettings.Visible = DefaultBoolean.False;
The problem is, if I remove this setting, tab ordering in the grid doesn't work any more, ie. I can't tab passed the readonly cell.
I need to have:
EditFormSettings.Visible = DefaultBoolean.True; for tabbing to work.
Without it, the grid tabs all editable cells until the read only cell but then none after the read only cell. See the attached image for more info.
How can I setup a gridview so that I can update read only cells in batch mode using clientside batchEditApi.SetCellValue function but also maintain proper tabindex?
Regards,
Dave
Hello David,
>>> The problem is, if I remove this setting, tab ordering in the grid doesn't work any more, ie. I can't tab passed the readonly cell.
I need to have:
EditFormSettings.Visible = DefaultBoolean.True; for tabbing to work.
Without it, the grid tabs all editable cells until the read only cell but then none after the read only cell. See the attached image for more info.
<<< I am not sure that I completely understand the issue. If the column is not shown, it does not matter if it is read-only or not. Does the tabbing work when the read-only column is visible or not? It will also help if you provide us with related View files so we can understand your scenario better.
I am looking forward to hearing from you.
Hi Sergi,
I have put together a simple example with the issue outlined and attached it to this post.
When you run it, click on one of the rows on the start page to edit the fields. You will not that the 'Age' column is not editable, but the rest are.
If you put focus in the User Name column and click tab, focus shifts to Full Name, tab again and focus shifts to DOB, tab again and I would expect focus to shift to the Email column but it doesn't. This is the functionality I want to have working.
Now if you go into the solution file at:
> \Views\Home\_GridViewPartial.cshtml
and uncomment the following:
//column.EditFormSettings.Visible = DefaultBoolean.False; //Need this for tabindex to work
then the tabbing works right along the row, but then I can't use the following line to update the "Age" column:
GridView.batchEditApi.SetCellValue(grid.lastMultiSelectIndex, "Age", age);
So I'm kind of stuck. I want to be able to update the "Age" column, but also have the tabbing working.
Can you show me how to do this in the supplied solution?
Regards,
Dave
Hi,
I've reproduced the issue and passed it to our R&D team. Please bear with us.
In the meantime, you can use GridViewBatchEditMode.Cell and the following code:
function OnUserBatchEditStartEditing(s, e) { //Disable editing for certain columns var ageColumn = e.focusedColumn; if (ageColumn.fieldName == "Age") { e.cancel = true; // delete e.rowValues[ageColumn.index]; } }
I've attached the modified sample.
Thanks,
Artem