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
265
Triggering the DB update with the row template
posted

Hi,

I have a webgrid that uses a row template to edit some field of the row.  This works fine, except that the row is only updated in the database if the user tabs or clicks out of the row, and they don't seem to be doing that.  Is there a way I can force the focus to leave the row when they click the OK button in the template to trigger the DB update?

Any suggestions would be appreciated.  Thanks!

Here's a sample of the grid:

<igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server" Browser="Xml" DataSourceID="SqlDataSource1" DataMember="DefaultView"  EnableAppStyling="True" EnableTheming="False" StyleSetName="CMTool" StyleSetPath="ig_res" OnInitializeRow="UltraWebGrid1_InitializeRow" DataKeyField="DocId">

<Bands>

<igtbl:UltraGridBand SelectTypeRow="Extended" AllowUpdate="RowTemplateOnly" DataKeyField="DocId">

<Columns>...</Columns>

<RowEditTemplate>

[Template Input fields here...]

<input id="igtbl_reOkBtn" onclick="igtbl_gRowEditButtonClick(event);" style="width: 50px" type="button" value="OK" />

 <input id="igtbl_reCancelBtn" onclick="igtbl_gRowEditButtonClick(event);" style="width: 50px"type="button" value="Cancel" />

</RowEditTemplate>

Parents
  • 28464
    posted

    Hello,

    Thanks for writing. I was able to build a sample project and reproduce something similar. This is quite weird actually - I too would expect a postback to occur immediately after clicking OK, and not on subsequent row blur (focus on another row). So while I was able to find a workaround that may work for you (submitting the form after clicking OK explicitly with this updated code:

     <p align="center">
                                <input id="igtbl_reOkBtn" onclick="igtbl_gRowEditButtonClick(event); document.forms[0].submit();"
                                    style="width:50px;" type="button" value="OK">
                                    &nbsp;
                                    <input id="igtbl_reCancelBtn" onclick="igtbl_gRowEditButtonClick(event);"
                                        style="width:50px;" type="button" value="Cancel">
                                    </input>
                                </input>
                            </p>

    I think that you might want to double check with Developer Support if this is something they are aware of and if this is a bug or not (and if so, if it is resolved in a hotfix already). 

    Developer Support can be reached via the following link:

    http://devcenter.infragistics.com/Protected/SubmitSupportIssue.aspx

Reply Children