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
265
New record
posted

Hi everyone

Could I add an empty record to the end of the grid list to adding a new one record? 

p.s.: I know about :

<ig:XamGrid.AddNewRowSettings>
<ig:AddNewRowSettings AllowAddNewRow="Bottom" />
</ig:XamGrid.AddNewRowSettings>

But I want to have this row at the end of the ItemSource list.

Parents
No Data
Reply
  • 34810
    Offline posted

    Hello Gleb,

    There currently does not exist a way to place the AddNewRow of the XamGrid into the ItemsSource collection bound to the XamGrid unless that AddNewRow gets committed with a new data item, in which case it essentially just becomes a new Row rather than the AddNewRow. This is because when the AddNewRow is blank, it has no data item actually associated with it, and this remains true until the row is edited.

    If you would like to achieve this in an alternate route, I would actually recommend against using the AddNewRow in the XamGrid, and add a placeholder, blank data item to the end of your bound ItemsSource. By handling the CellExitedEditMode or RowExitedEditMode events on the XamGrid, you can catch when this blank row has been edited and add a new blank row to the end of your ItemsSource collection to continue persisting this custom add-new row functionality. The event arguments of these events can net you the Cell or Row that has been edited so that you can check for a Value in your Cell elements to be sure that a Value actually has been added and a new blank row should be created.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer

Children