简体   繁体   English

如何将焦点放在网格的最后一行

[英]How to set focus on last row of grid

I need to set focus on the last row of the grid after a grid row updation takes place. 网格行更新发生后,我需要将注意力集中在网格的最后一行。 Can anyone help me out on this? 有人可以帮我吗?

Below is my gridview, 下面是我的网格视图

<asp:GridView ID="grdViewForComment" runat="server" OnRowDataBound="Row_DataBound" AutoGenerateColumns="false">
    <Columns>
        <asp:TemplateField HeaderText="Advanced search">
            <ItemTemplate>                                                         
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>

Check adding below code 检查添加以下代码

grdViewForComment.Rows[19].Focus(); grdViewForComment.Rows [19] .Focus(); // RowIndex here. //这里是RowIndex。

grdViewForComment.Rows.Count-1 grdViewForComment.Rows.Count-1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM