I have a master webDataGrid which on row change needs to update a child webDataGrids entityDataSource. I am attempting to do this with a where parameter, but receive the following error - how can I achieve this?
EntityDataSource Where
<WhereParameters> <asp:ControlParameter ControlID="uxParentGrid" Type="Int32" Name="ParentId" PropertyName="SelectedValue" /> </WhereParameters>
ERROR
DataBinding: 'Infragistics.Web.UI.GridControls.WebDataGrid' does not contain a property with the name 'SelectedValue'.
Hello,
Can you please share your code used for updating the child WebDataGrid. From the provided details I am unable to tell what is the reason for this error. Any other information about your scenario would be helpful. Thank you.
Can you provide an example of what's required for master/detail webDataGrids using entityDataSources? I would like to take advantage of the entityDataSource built in CRUD functionality so I can add records to either grid, edit and delete records from the one screen.
I haven't included any sample code as it would complicate what is a simple problem, I haven't built anything that would be useful to this discussion (I've been going around in circles!). Hence, I would like to use your recommended approach for this scenario. Thanks.
I am attaching a sample, demonstrating this functionality. You have to set up the connection string to link to your local Northwind database.
Please let me know if you have any questions.
Thanks, that solves my question.
I'm glad I could help.
Let me know if you have any further questions.
Hi Nikolay,
A couple more questions on this one:
Thanks.
I would suggest you to enable Activation behavior in order to save the changes when the focus on the cell is lost. If you want to update the data source immediately after editing, you could try to call the commit() method of the editingCore on ExitedEditMode client-side event:
grid.get_behaviors().get_editingCore().commit();
And to achieve async binding of the details-grid, you could place the two grids in separate UpdatePanels and for the second grid register an AsyncPostBackTrigger with ControlID value the master grid's id and EventName="RowSelectionChanged".
Please let me know if you have any further questions.
Also, how can I run custom server side logic on add and delete of a child grid record? I'm expecting there to be some events that fire on server side for this, how do I get this part going?
i.e. I need to perform additional data base work with each insert/delete.
Thanks I've got that part working.
How can I set the child foreign key to the selected parent on adding a new record?