I am using AddNewRow functionality of XDG (displayed by +). Also i have added a last column field with delete button to delete selected row( using delete selected row command). Since i have added delete button with each row by altering cellvaluepresentor style and adding button template to it, this delete button also appears in Addnew template row which is not required there. Can we not any way selectively hide button from addnew template row and just display that with each data row. Or change the functionality of addnew row button to add row in grid with button in the data row still function to delete the record.
Hello Tarun,Thank you for your feedback. I am glad to know that I was able to help you achieve the functionality you were looking for. I believe this thread can help other people looking for a similar solution.
If you require any further assistance on this matter, please do not hesitate to ask.
Thanks!! it worked!!
Hello Tarun, In order not to display the Button template for the CellValuePresenter when the record is an AddNew record, an approach I can suggest you is to create a DataTrigger for the respective CellValuePresenterStyle and bind for the IsSpecialRecord property of the current record. Since the AddNew record is a special record, when the property is resolved as True, the CellValuePresenter's Visibility can be set to Collapsed. <igDP:Field.CellValuePresenterStyle> <Style TargetType="{x:Type igDP:CellValuePresenter}"> <Style.Triggers> <DataTrigger Binding="{Binding Path=Record.IsSpecialRecord, RelativeSource={RelativeSource Self}}" Value="True"> <Setter Property="Visibility" Value="Collapsed" /> </DataTrigger> </Style.Triggers> </Style></igDP:Field.CellValuePresenterStyle>I have prepared a sample application, where I have implemented the behavior from above. If you require any further assistance on this matter, please do not hesitate to ask.