Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2116
Is there a way to set a record to read-only based on a value in a field?
posted

Similar to conditional formatting.  Can't figure out how to set a read-only state at the row level instead of the column level.

Parents
No Data
Reply
  • 35319
    posted

    Hello,

     

    I have been looking into your question and we do not provide a built-in functionality for making a record read-only. You can achieve this behavior by handling the ‘EditModeStarting’ event of the XamDataGrid and checking the value of the specific field and cancelling the event like e.g. :

     

    private void xamDataGrid1_EditModeStarting(object sender, Infragistics.Windows.DataPresenter.Events.EditModeStartingEventArgs e)

            {

                if (e.Cell.Record.Cells[1].Value.ToString() == "Z4" || e.Cell.Record.Cells[1].Value.ToString() == "Ram")

                {

                    e.Cancel = true;

                }

            }

     

    If you need any further assistance on this matter, feel free to ask.

     

     

     

Children