How to Set Rad Grid Batch Edit Item Template Column Default Focus

5 posts, 1 answers
  1. Senthil
    Senthil avatar
    19 posts
    Member since:
    Aug 2012

    Posted 05 Dec 2014 Link to this post

    How to set default focus to RaDComoBox in javascript. We used Edit mode is Batch.
     <telerik:GridTemplateColumn DataField="Product" UniqueName="countrycode" ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="120px"
                                                HeaderText="Product" ItemStyle-Height="18px">
    <EditItemTemplate>
     <telerik:RadComboBox ShowDropDownOnTextboxClick="true" EnableEmbeddedSkins="false" DropDownWidth="265px" Height="300px" runat="server" ID="txt"     Style="font: 9px Verdana, Arial, Sans-serif;" Width="120px" BackColor="#ffffcc" EnableVirtualScrolling="true" MarkFirstMatch="true"
                                                        DataSourceID="sqlproduct" AutoPostBack="false" DataTextField="product" DataValueField="productid" 
                                                        HighlightTemplatedItems="true" >


                                                        <ItemTemplate>
                                                            <table style="width: 245px; text-align: left">
                                                                <tr>
                                                                    <td style="width: 40px;"><%# DataBinder.Eval(Container.DataItem, "productid")%> </td>
                                                                    <td style="width: 205px;"><%# DataBinder.Eval(Container.DataItem, "productname")%>  </td>
                                                                </tr>
                                                            </table>
                                                        </ItemTemplate>
                                                    </telerik:RadComboBox>
                              

                                                </EditItemTemplate>

    </telerik:GridTemplateColumn>
  2. Eyup
    Admin
    Eyup avatar
    3015 posts

    Posted 10 Dec 2014 Link to this post

    Hi Senthil,

    The combo should be automatically focused when its container cell is opened for editing as with other input controls:
    http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/batch-editing/defaultcs.aspx

    I've tried the provided column definition within a web site of my own and the focusing works as expected. Can you please verify whether you are using the latest release version of the controls? Or do you have something else in mind?

    Regards,
    Eyup
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Senthil
    Senthil avatar
    19 posts
    Member since:
    Aug 2012

    Posted 11 Dec 2014 in reply to Eyup Link to this post

    Hi Eyup
    Thanks for the response.
    But my question is Press Enter Key to set focus to next row edit item template column one by one on Enter key press how to do that.  
    If I Press Enter key value has been changed and the next row has been selected but the edit item template column not focused.
    How can I solve this problem. 

    Thanks,
    Senthil 
























  5. Answer
    Eyup
    Admin
    Eyup avatar
    3015 posts

    Posted 17 Dec 2014 Link to this post

    Hi Senthil,

    You can add the following script on your page to achieve the requested functionality:
    Copy Code
    Copy Code
    Telerik.Web.UI.GridBatchEditing.prototype._handleKeyboardNavigationOrg =
        Telerik.Web.UI.GridBatchEditing.prototype._handleKeyboardNavigation;
    Telerik.Web.UI.GridBatchEditing.prototype._handleKeyboardNavigation = function (e) {
        if (e.keyCode == 13) {
            e.keyCode = 9;
        }
        this._handleKeyboardNavigationOrg(e);
    };

    Hope this helps.


    Regards,
    Eyup
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. Senthil
    Senthil avatar
    19 posts
    Member since:
    Aug 2012

    Posted 22 Dec 2014 Link to this post

    Hi Eyup.
    Thanks. Its work fine.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017