C# superGridControl控件的用法

.Net技术 码拜 9年前 (2015-02-12) 3732次浏览 0个评论

我想删除superGridControl中选中的行,
private void 删除ToolStripMenuItem_Click(object sender, EventArgs e)
{
DialogResult result = MessageBox.Show(“是否删除图片?”, “删除图片”,MessageBoxButtons.YesNo, MessageBoxIcon.Information);
if (result == DialogResult.Yes)
{
SelectedElementCollection col = this.ListGrid1.PrimaryGrid.GetSelectedRows();

MessageBox.Show(col.Count.ToString());
if (col.Count > 0)
{
GridRow row = col[0] as GridRow;
MessageBox.Show(row.RowHeaderText);
}
//manager.DeleteImageById(
}
}可是的到的行书是0,为什么?到底如何得到选中的行啊!

C# superGridControl控件的用法
在DataGridView1控件中删除选中的行方法这样,superGridControl没用用过,方法是不是类似?
foreach (DataGridViewRow r in DataGridView1.SelectedRows) 
{ 
    if (!r.IsNewRow) 
    { 
        DataGridView1.Rows.Remove(r); 
    } 
}


C# superGridControl控件的用法
10分
可是的到的行书是0,是不是没有数据?
C# superGridControl控件的用法
不是,有数据的。我superGridControl中的Cell中有值,我只想得到RowHeaderText。
superGridControl的用法和dataGridView的用法不一样,superGridControl是第三方控件
C# superGridControl控件的用法
      private void ListGrid_RowDoubleClick(object sender, GridRowDoubleClickEventArgs e)
{
SelectedElementCollection col = this.ListGrid.PrimaryGrid.GetSelectedRows();
SelectedElementCollection s=ListGrid.GetSelectedRows();
// GridContainer dh=e.GridRow.Index;
int dd=e.GridRow.Index;//得到选中的行行数是从0开始的
// MessageBox.Show(dd.ToString());
// GridRow g= col[dd] as GridRow;
//MessageBox.Show(g.Cells[0].Value.ToString());
if (col.Count > 0)
{
GridRow r = col[0] as GridRow;
//MessageBox.Show(r.Cells[0].Value.ToString());
MessageBox.Show(r.RowHeaderText);
}
//GridRow r = col[0] as GridRow;
//MessageBox.Show(r.Cells[0].Value.ToString());
}
在双击当中就可以得到行数据
C# superGridControl控件的用法
10分
估计你点删除ToolStripMenuItem_Click,没有选择行
C# superGridControl控件的用法
system.out.publctln("aa");

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明C# superGridControl控件的用法
喜欢 (1)
[1034331897@qq.com]
分享 (0)

文章评论已关闭!