This is a migrated thread and some comments may be shown as answers.

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

4 Answers 210 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Senthil
Top achievements
Rank 1
Senthil asked on 05 Dec 2014, 06:50 AM
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>

4 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 10 Dec 2014, 09:44 AM
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.

 
0
Senthil
Top achievements
Rank 1
answered on 12 Dec 2014, 05:32 AM
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 
























0
Accepted
Eyup
Telerik team
answered on 17 Dec 2014, 06:51 AM
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.

 
0
Senthil
Top achievements
Rank 1
answered on 23 Dec 2014, 04:38 AM
Hi Eyup.
Thanks. Its work fine.
Tags
General Discussions
Asked by
Senthil
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Senthil
Top achievements
Rank 1
Share this question
or