How do I not focus on C1GridView when press tab

Posted by: h-nguyenduc on 19 October 2020, 1:04 pm EST

  • Posted 19 October 2020, 1:04 pm EST

    Hi admin,

    I have a project using the C1GridView control. We are expecting the focus order when pressing Tab on the program will not focus on C1GridView.

    I’m having trouble always focusing on C1GridView when I press Tab. We have tried setting the TabIndex property but with no success.

    Would you mind suggesting us the property that can be set to not focus on C1GridView when pess tab?

    Thanks you so much,

  • Posted 19 October 2020, 5:58 pm EST

    Hi,

    Setting the lower TabIndex will get the focus at the end when all the elements are focused.

    Please refer to the following code snippet for reference:

     <asp:Button ID="Button1" runat="server" Text="Postback" OnClick="Button1_Click" TabIndex="1"/>
                <asp:TextBox ID="TextBox1" runat="server" Text="T" TabIndex="1" />
                <wijmo:C1GridView ID="C1GridView1" runat="server" AutogenerateColumns="false" Height="500" Width="800"
                    OnRowEditing="C1GridView1_RowEditing" OnClientRendered="OnGridRender" TabIndex="-1" ShowFilter="true" >
                    <ScrollingSettings Mode="Vertical" VirtualizationSettings-Mode="Rows" ></ScrollingSettings>
                    <Columns>
                        <wijmo:C1BoundField HeaderText="Drug" DataField="Drug" ShowFilter="true"></wijmo:C1BoundField>
                        <wijmo:C1BoundField HeaderText="Dosage" DataField="Dosage" ShowFilter="true"></wijmo:C1BoundField>
                        <wijmo:C1BoundField DataField="Dosage" HeaderText="Dosage" Width="200" SortExpression="Dosage" ShowFilter="true"></wijmo:C1BoundField>
                        <wijmo:C1BoundField DataField="Drug" HeaderText="Drug" Width="200" SortExpression="Drug" ShowFilter="true"></wijmo:C1BoundField>
                        <wijmo:C1BoundField DataField="Patient" HeaderText="Patient" Width="200" SortExpression="Patient" ShowFilter="true"></wijmo:C1BoundField>
                        <wijmo:C1BoundField DataField="Date" HeaderText="Date" Width="200" SortExpression="Date" ShowFilter="true"></wijmo:C1BoundField>   
                    </Columns>
                </wijmo:C1GridView>
                <asp:TextBox ID="TextBox2" runat="server" Text="" TabIndex="1" ></asp:TextBox>
    

    Regards,

    Manish Gupta

  • Posted 19 October 2020, 7:57 pm EST

    Hi manish.gupta,

    As mentioned above, we also changed the TabIndex value with no success (even in case of value = -1).

    Thanks for support!!!

  • Posted 20 October 2020, 5:13 pm EST

    Hi manish.gupta,

    I put my sample code in below, please take a look. Thank you.

    
    <table id="Table8" cellspacing="1" cellpadding="1" width="100%" border="0" style="z-index: 108; left: 8px; position: absolute; top: 115px; height: 10px;">
      <tr> 
        <td align="center"> 
          <font face="MS UI Gothic"> 
            <table class="tablemain" cellspacing="0" cellpadding="0" border="0"> 
              <tbody> 
                <tr> 
                  <td align="center"> 
                    <table cellspacing="0" cellpadding="0" border="0" style="border: #ffffff 1px solid; border-bottom-width: 0px; width: 896px; background: #d3d3d3; font-weight: normal; padding: 4px;">
                    
                      <tbody> 
                        <tr> 
                          <td style="font-size: 8pt; font-family: Verdana; font-weight: normal; line-height: 15px"><span>【原契約債権残高】 新規レコードを追加⇒ </span>
                          
                            <input type="button" id="btnDeleteRow" class="btndeleterow" runat="server" onserverclick="btnDeleteRow_Click" />
                            
                            ETC...
                            
                        </tr> 
                      </tbody> 
                    </table> 
                </tr> 
                <tr> 
                  <td> 
                    <wijmo:c1gridview id="UltraWebGrid1" tabindex="-1" runat="server" height="144px" width="893px" datakeynames="区分" allowclientediting="true" OnRowUpdating="UltraWebGrid1_RowUpdating" autogeneratecolumns="false" scrollingsettings-mode="Auto" showclientselectiononrender="false"> 
                      <CallbackSettings Action="Editing" Mode="Full" /> 
                      <Columns> 
                        <wijmo:C1TemplateField> 
                          <ItemStyle CssClass="selectcell" /> 
                        </wijmo:C1TemplateField> 
                        <wijmo:C1TemplateField HeaderText="区分"> 
                          <ItemTemplate> 
                            <asp:DropDownList ID="dropDown1" runat="server" AppendDataBoundItems="true" CssClass="gridDropDown dropdownAlign"> 
                            </asp:DropDownList> 
                          </ItemTemplate> 
                        </wijmo:C1TemplateField> 
                        
                        <wijmo:C1TemplateField HeaderText="原契約番号"> 
                          <ItemStyle CssClass="gridTextBox" /> 
                          <ItemTemplate> 
                            <asp:TextBox ID="txt原契約番号" runat="server" Text='<%# Eval("原契約番号") %>' CssClass="gridTextBox txtBoxAlign"></asp:TextBox> 
                          </ItemTemplate> 
                        </wijmo:C1TemplateField> 
                        
                         ETC ...
                        
                      </Columns> 
                    </wijmo:c1gridview>
                    
                  </td> 
                </tr> 
                <tr> 
                  <td style="overflow: hidden; width: 100%" align="center"> 
                    <div style="overflow: hidden; height: 20px; width: 100%"> 
                      <table class="footer" style="height: 100%; table-layout: fixed; width: 1195px; position: relative; left: 0px" cellspacing="0" cellpadding="0" border="0"> 
                        <tfoot> 
                          <tr class="wijmo-wijgrid-footerrow"> 
                            <td class="footercell" style="width: 18px"> 
                              <img style="visibility: hidden;height:18px" border="0" imgtype="blank"></td> 
                            <td id="UltraWebGrid1f_0_1" style="line-height:18px;font-size: 8pt; border-top: #ffffff 1px solid; font-family: Verdana; border-right: #808080 1px solid; width: 85px; border-bottom: #808080 1px solid; font-weight: normal; text-align: left; padding-left: 3px; border-left: #ffffff 1px solid; background-color: #cfe2fa">
                              <nobr>合計</nobr>
                            </td>
                            <td id="UltraWebGrid1f_0_2" class="footercell" runat="server" style="width: 130px">&nbsp;</td>
                            
                            ETC...
                            
                          </tr>
                        </tfoot> 
                        <tbody></tbody> 
                      </table> 
                    </div> 
                  </td> 
                </tr> 
              </tbody> 
            </table> 
          </font> 
        </td> 
      </tr> 
    </table>  
    
    
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels