我最近安装了syncfusion(之前使用的是telerik),我正在尝试为window.angularGlobalData
切换RadGridView
,我的功能似乎没有像它那样工作
GridDataBoundGrid
private void OnColumnHeaderMouseClick(object sender, ColumnClickEventHandler e) {
if (e.Row is GridViewTableHeaderRowInfo) {
int index = tabControl1.SelectedIndex;
EditHeader eh = new EditHeader(this.UpdateHeader);
eh.TextBox1.Text = ds.Tables[index.ToString()].Columns[e.ColumnIndex].ToString();
eh.TextBox2.Text = e.ColumnIndex.ToString();
eh.Show();
}
}
不存在e.Row
不存在且GridViewTableHeaderRowInfo
不存在
这点是在单击列标题时打开应用程序的另一部分,我不确定是否要从头开始重写函数。
那么有什么事情可以直接与我的功能一起工作,或者我必须编写一个解决方法
答案 0 :(得分:0)
默认情况下,单击表格单元格时会触发 CellClick 事件。 CellType 属性可用于检查CurrentCell是否为列标题单元格, ColIndex 属性可用于获取当前列索引。请使用代码和示例,
代码段
//Event Triggering
this.gridDataBoundGrid1.CellClick += GridDataBoundGrid1_CellClick;
//Event handling
private void GridDataBoundGrid1_CellClick(object sender, GridCellClickEventArgs e)
{
//To Check for column header cell
if(this.gridDataBoundGrid1[e.RowIndex, e.ColIndex].CellType == "ColumnHeaderCell")
{
//Your code show the another part of the project.
}
}
请注意
请使用以下KB获取基于索引的特定记录/行。
KB链接:https://www.syncfusion.com/kb/5953/how-to-get-the-row-data-from-griddataboundgrid
示例链接:https://drive.google.com/file/d/0Bwk9nUFE3rlxR0xZMXRhU0xqdTA/view?usp=sharing
此致
Arulpriya