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
390
Nested Ultrawebgrid not binding on RowEditTemplate open
posted

I have a Ultrawebgrid in a RowEditTemplate of another Ultrawebgrid that I need to fill with data from a SQL database using a stored procedure with a parameter being the selected row ID.

I believe it is a timing issue, but I used a hidden input that is populated with the SelectedRowID in the parent grid's BeforeTemplateOpen event.  I think at that time the SQLDataSource is already ran the procedure with a null value.  Am I right in my thinking, and if so, how do I make sure that the SQLDataSource gets it's parameter filled before requesting the data and filling the child grid?

Here's code of the setting of the value of the hidden input:

var hdnitemid = document.getElementById(gridName + '_ctl00_hdn_itemid');

hdnitemid.value = CheckForNull(row.getCell(0).getValue(), '');

And here's my code for the datasource bound to the hidden input field with a ControlParameter:

 <asp:SqlDataSource ID="sds_links" runat="server" ConnectionString="<%$ ConnectionStrings:MRVConnectionString %>" SelectCommand="SELECT * FROM [tbl_links] WHERE ([link_item_id] = @link_item_id)">

<SelectParameters>

<asp:ControlParameter ControlID="lbl_itemid" Name="link_item_id" PropertyName="Text" Type="Int32" />

</SelectParameters>

</asp:SqlDataSource>

 Thanks in advance for any help.

Will

 

Parents
No Data
Reply
  • 390
    posted

    I've looked into this some more, and I'm certain it's a timing issue.  I'm just not sure which Ultrawebgrid event to use to populate the hiddenvalue field.  I have a UWG with a rowedittemplate, and inside that template is a user control I made that has a sqldatasource and a datalist.  It seems to be filling the data for that row when binding the UWG, but I need it to use a column's value in the selected row as the select parameter for the sqldatasource in the user control.  Can someone please point me somewhere that maps out the timing of the events of the UWG, or an example of what I'm trying to do?

    Thanks, Will

Children
No Data