Hello,
On a xamgrid, i use a custom validation. But I have one problem and need something.
Can we lock or disable all the rows i don't edit?
Thanks,
Regards.
Hello Cosoluce_Stones,
I was looking into your questions and I believe that you can disable the cells that are not in the Active row like this:
foreach(Row r in xamGrid1.Rows)
if(!r.IsActive)
foreach(Cell c in r.Cells)
c.Control.IsEnabled = false;
However I am not sure that I understand the behavior you are working on. So if this doesn’t suit your scenario, could you please provide me with more details about the functionality you are trying to achieve.
Thanks in advance.
I use your code on the RowEnteringEditMode event. And i changed it to false on the RowExitedEditMode event.
However, when I use a AddNewRow, I still have c.Control equals to null and cant change any cell enable status.
Can you help me?
Regards
I investigated the behavior you mentioned and I believe that the if you place this snippet in the handler of the RowEnteringEditMode event handler the Control property is null only for the Cells that are not currently in view. This is why I can suggest you modify the code I sent by checking if the Control Is currently null.
if (xamGrid1.ActiveItem != null)
{
foreach (Row r in xamGrid1.Rows)
if (!r.IsActive)
foreach (Cell c in r.Cells)
if (c.Control != null)
}
If this still doesn’t suit your scenario, please let me know.
I am just checking have you been able to resolve your issue? If you still need any assistance on the matter do not hesitate to ask.
Yes, thanks a lot