Home Forums WPF controls Xceed DataGrid for WPF Read Only Cells

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #26063 |

    How would you go about programatically setting certian cells to read only. I would like to restrict certain cells based on the data in them.

    thanks in advance

    Imported from legacy forums. Posted by Mike (had 2283 views)

    Xceed Support
    Member
    Post count: 5658

    You would need to get the Xceed.Wpf.DataGrid.DataRow container using the GetContainerFromItem method and then access the appropriate cell through the DataRow.Cells collection. You must remember that containers only exist if its item is in the viewport.

    An easier way would be to use the CellContentTemplate and CellContentTemplateSelector properties on a particular column, or create an implicit style that targets the DataCell type and that uses DataTriggers to change the desired property.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 321 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks for thew quick responce. do you have any sample code to point me in the right direction. I am new to using the grid and am not sure where to start for this.

    thanks

    Imported from legacy forums. Posted by Mike (had 3424 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.