陋居

淡薄名利,修身养性

  C++博客 :: 首页 :: 联系 :: 聚合  :: 管理
  31 Posts :: 1 Stories :: 4 Comments :: 0 Trackbacks

常用链接

留言簿

我参与的团队

搜索

  •  

最新评论

阅读排行榜

评论排行榜

如何得到DataGrid当前选中行的数据(VC++)

/*================================
* Function:
* Author:wuhuiran(06-02-14)
* Desc:得到DataGrid中当前选中行的值(字符)
==================================*/
 // 用CStringArray保存得到的数据
 CStringArray arrGetValue;
 arrGetValue.RemoveAll();
 
 VARIANT index;
 CColumns columns;
 CColumn column;
 index.vt=VT_INT;
 
 columns=m_wndGrid.GetColumns();  // 得到当前选中行的列集
 long nCount = columns.GetCount(); //列数

 for(int i = 0; i < nCount; i++)
 {
  index.lVal = i;
  column = columns.GetItem(index);//顺序得到单元格的值
  CString strTemp;
  strTemp = column.GetText();
  arrGetValue.Add(strTemp);

 }


posted on 2010-08-02 13:29 eircQ 阅读(1648) 评论(1)  编辑 收藏 引用

Feedback

# re: 如何得到DataGrid当前选中行的数据(VC++)转 2010-12-22 15:02 eivlbinary
谢谢了,童鞋  回复  更多评论
  


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理