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
1230
Datatriggers in XamGrid for Silverlight
posted

I used dattriggers in the XamDataGrid for WPF but could not use

 

 

xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"

 

 

 

 

 

xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"

in the XamGrid.  Are there any plans to allow datatriggers in the XamGrid?  I wanted to allow or disallow editing of cells based a condition of the data and had to use the ActiveCellChanging and CellEnteringEditMode events to prevent editing of a cell based on a data condition.  By the way, setting e.cancel = true in the ActiveCellChanging event did not prevent the cell from Activating, I also had to trap in the CellEnteringEditMode event.

Parents
  • 17559
    posted

    Hello drdonna,

     

    I was looking into your questions, and I can see the issue you are describing. Still please have in mind that the using of a DataTrigers is a Silverlight limitation, so their support isn’t currently built in our XamGrid. However after some investigation of the issue I believe that the functionality you are requiring can be achieved by handling the CellClicked event of the XamGrid and change the AllowEdit property of the control from the handler:

     

            private void xamGrid_CellClicked(object sender, CellClickedEventArgs e)

            {

                if(e.Cell.Value....)

                    xamGrid.EditingSettings.AllowEditing = EditingType.None;

                else

                    xamGrid.EditingSettings.AllowEditing = EditingType.Cell;

            }

     

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

Reply Children