如何在不使用鼠标asp.net的情况下单击Gridview行 [英] how to Click a Gridview Row without using mouse asp.net

查看:63
本文介绍了如何在不使用鼠标asp.net的情况下单击Gridview行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Asp.net 3.5 Web应用程序,C#

如何在不使用鼠标的情况下单击gridview行

当我单击一行时我有一个gridview,但是无法在gridview上使用向上和向下箭头键

我希望在填充gridview时自动单击第一行,这样我就不必使用箭头键再次单击它来上下移动

请帮忙

谢谢
Faiz

Asp.net 3.5 web Application,C#

how can i click a gridview row without using mouse

I have a gridview when i click a row then im able to use up & down Arrow keys on the gridview

I want that when the gridview is populated then the first row automatically get clicked, so that i dont have to click it again to go up and down using arrow keys

Please help

Thanks
Faiz

推荐答案

您正在寻找的内容被称为将焦点设置在第一行上,从而使键盘可以根据您的需要工作.

试试:
What you are seeking is termed as setting focus on first row such that keyboard works as per you want.

Try:
// GridView1 is the name of your GridView
// After grid databind, set focus to 1st Row
GridView1.Rows[0].Focus(); 



我不确定我是否正确,但希望它能对您有所帮助
也许它将为您提供所需的想法.
Hi ,
I''m not sure if i get you right but hope it help you
Maybe it will Give you idea for what you looking for .
protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        this.Button2_Click(this, new EventArgs());

    }
}
protected void Button1_Click(object sender, EventArgs e)
{
}
protected void Button2_Click(object sender, EventArgs e)
{
    Response.Write("<script>alert('Button 2')</script>");
}



最好的问候
米特瓦里(M.Mitwalli)



Best Regards
M.Mitwalli


这篇关于如何在不使用鼠标asp.net的情况下单击Gridview行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆