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
510
XamGrid: Accessing/Manipulating AddNewRow
posted

Hi,

 

We are using XamGrid 10.3, we have following requirement:

We have "Add New Row" in top row of  xamgrid, it has 4 columns "Security(editable), Description, Quantity(editable), Status".

1. on entering security, for ex: MSFT, I need to hit a WCF service and pull description

2. on entering Quantity, I need to hit another WCF service, and see if it is available I need to set the status to available or else rejected; and then need to add the whole row to grid so that user can add another security info.

can you pls help on below questions:

1. How can I update the Add new row values once I get security description/status from server?

2. How can I trigger the event to add this new row to actual row collection on tab out of Quantity?

 

 

regards,

kthatik

Parents
  • 40030
    Offline posted

    Hi, 

    So you can get access to the AddNewRow's data like this:

    ((RowsManager)this.xamGrid1.Rows[0].Manager).AddNewRowTop.Data

    Or, if you're in a row event, by using:

    e.Row.Data

    So, while you're waiting for Quantity to be returned from the server, you should handle the RowExitingEditMode event.

    if (e.Row.RowType == RowType.AddNewRow), and you haven't gotten Quantity back yet, you should set e.Cancel = true. 

    Once you get it back, you can handle, the RowAdding event, and check to see if you're allowed to add, if not, then set e.Cancel to true in that event. 

    Hope this helps, 

    -SteveZ

Reply Children