Cannot find RowClickEventArgs in DevexpressGridView

倾然丶 夕夏残阳落幕 提交于 2019-12-20 06:24:29

问题


I'm a new to DevexpressGridView.

I have a Dev Grid in my webpage, and I want to handle the RowClick Event like:

private void GridView1_RowClick(object sender, RowClickEventArgs e)
{
    if(a row is selected)// how???
        Button1.Visible=true;
}

But when it has an error: "cannot resolve symbol RowClickEventArgs", this is first time I know about Devexpress. So I wonder if my RowClickEventArgs syntax is wrong??? I've tried to find the solution by searching google for many times, but I still cannot get the right thing.

Can you give me a right syntax???

And one more question, how can I check " is there any row selected ?"

Help!


回答1:


So it would be like this:

private void GridView1_Click(object sender, EventArgs e)
{
    System.Data.DataRow row = GridView2.GetDataRow(GridView2.FocusedRowHandle);
    if(row[0].ToString() == "")
    {
          //YOUR LOGIC
    }

}

GridView2 is your main view.



来源:https://stackoverflow.com/questions/19217076/cannot-find-rowclickeventargs-in-devexpressgridview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!