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

tabIndex editTemplateItem

1 Answer 19 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ali
Top achievements
Rank 1
Ali asked on 15 Jul 2014, 02:27 PM
hi
I use radgrid in batch mode with editTemplateItem .
i have 2 question:
I have 3 column .first  column and Third column are radtextbox and second column is button .now i want in first textbox when press tab focus goes to third column(second textbox) in other word don't focus button with tab.

I have 3 column .in all column i have textbox .some times second texbox disable in first textbox when i press tab focus dose not go to third textbox why how can solve this problem

sorry for my poor english

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 18 Jul 2014, 09:32 AM
Hello Ali,

In order to achieve the described behavior you could set the TabIndex property for the TextBox controls in the first and the third columns of RadGrid. This way when the first TextBox is focused and the Tab key is pressed the focus would jump to the TextBox in the third column.

Check out the sample markup below that illustrates the approach.

<telerik:RadGrid runat="server" ID="RadGrid1"
    OnNeedDataSource="RadGrid1_NeedDataSource"
    AutoGenerateColumns="false"
    AllowPaging="true" PageSize="10" >
     
    <MasterTableView EditMode="Batch" BatchEditingSettings-EditType="Row">
 
        <Columns>
            <telerik:GridTemplateColumn DataField="Column1" HeaderText="Column1" UniqueName="Column1">
                <ItemTemplate>
                    <asp:Label Text='<%# Eval("Column1") %>' runat="server" ID="Label1" />
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox runat="server" ID="TextBox1" TabIndex="1" />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn DataField="Column2" HeaderText="Column2" UniqueName="Column2">
                <EditItemTemplate>
                    <asp:Button Text="click" runat="server" />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn DataField="Column3" HeaderText="Column3" UniqueName="Column3">
                <ItemTemplate>
                    <asp:Label Text='<%# Eval("Column3") %>' runat="server" ID="Label3" />
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox runat="server" ID="TextBox2" TabIndex="2" />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>


Regards,
Viktor Tachev
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.

 
Tags
Grid
Asked by
Ali
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or