Hi,
In my ultragrid, I am trying to implement a concept of an unbound row. The scenario is like this.
I have order entry form. Once user enters an order, his order will be entered in the database and will be pending an approval from the administrator. Now, once the order is approved, it is entered in the final table which is bound to the ultragrid. Meanwhile, the user should be able to see his order in the same grid as pending.
I am not maintaining the state of the order(pending/approved/canceled) in the tables. So, one approach I thought is having an unbound row in the datagrid, with different formatting so that user will be aware that the order is pending.
Once the order is approved, the data is entered in the database and as it is a bound datagrid, it will take care of the added order.
Can someone suggest how should I proceed with that?
There is no way to have an unbound row in the grid. In order for the grid to display a row, that row MUST exist in the grid's DataSource.
Perhaps what you could do is bind the grid to a copy of your "real" data source instead of binding it directly to it.
Thanks Mike for your suggestion. I actually followed an alternative approach. Usually when we add an order to the database, we are returned with the order ID. Here, I am maintaining one more field called temporderID which actually contains the combination of the user+domain+cur date and timestamp. So, when the order is approved by the admin, I get the Order ID for the order.
I am maintaining the hashtable which keeps track of the tempIDs and objects associated with them. So, once the confirmation is received, I dont have to loop around the grid for update the respective order.
Here, I have used the concept of messaging, where, I am actually not adding the records to DB. Instead, I am sending the messages to EMS, which are listened by administrative apps which further process the order and publish a message with the order confirmation, which I listen on my application and update the records accordingly.
Seems complicated, but it works :)