Hi Tarun Nayyar, We can attach only one data input to the grid.
I am not sure if I understand your requirement clearly. Following is my suggestion based on my understanding:
You need to create first service/procedure to get data and second one to delete the selected row. Bind the output of first one as input to the grid.
Now on click of button invoke the second service to delete the selected data. Additionally, on ServiceInvokeCompleted of second service call the first service so that you have the latest updated data available via the first service which will be updated automatically in the grid.
I hope it helps.
Thanks Ankit for your reply.
But scenario is different on my end.
I'm using two Stored Procedures as Assign SP and UnAssign SP for data.
- Assign SP will get input parameters from selected Drop Down List and will return values from Database,into result as Infotable....which I will bind to DataGrid.
- Now,User select one Row from DataGrid and based on selection of Row, values in that Row should be stored into the database through UnAssign SP. Also,that selected row should be removed.
So,This way same DataGrid will get populated from list data and selected row data should be stored in database and get removed at same time.
Use a session variable. Write a service that takes the input of your stored procedure and returns an infotable which you use to bind to the datagrid. Your code to call AssignSP and UnAssignSP will simply pass the results of the stored procedures to your new service and the datagrid will update accordingly. There is another post on the forum regarding using session variables to manage data being viewed in a datagrid.
Thanks Wayne for reply but I didn't want to use session due to some strict requirements.
I found another way of using a common service to fetch rows from DB based on Inputs and call it on service Invoke completed of First button and second button. This way 1st click will send inputs and fetch rows,on its Invoke common service will fetch common rows and similar for 2nd click.
Hence grid will get updated with latest data in Database,