如何得到datagrid控件中第N行第M列的数据
怎么得到datagrid控件中第N行第M列的数据?
如题,没分了,给的分不多,谢谢
------解决方案--------------------
CColumns cols = m_Datagrid.GetColumns();
long lcol = cols.GetCount();
CColumn col;
float fColwidth = col.GetWidth();
short lrow=0;
C_Recordset rs = m_Adoc.GetRecordset();
while( ! rs.GetEof())
{
lrow++;
rs.MoveNext();
}
short i,j;
CString sPrint,sAll;
for(j=0;j <=lrow-1;j++)
{
for(i=0;i <=lcol-1;i++)
{
m_Datagrid.SetCol(i);
m_Datagrid.SetRow(j);
sPrint=m_Datagrid.GetText();
}
}
给你参考一下
如题,没分了,给的分不多,谢谢
------解决方案--------------------
CColumns cols = m_Datagrid.GetColumns();
long lcol = cols.GetCount();
CColumn col;
float fColwidth = col.GetWidth();
short lrow=0;
C_Recordset rs = m_Adoc.GetRecordset();
while( ! rs.GetEof())
{
lrow++;
rs.MoveNext();
}
short i,j;
CString sPrint,sAll;
for(j=0;j <=lrow-1;j++)
{
for(i=0;i <=lcol-1;i++)
{
m_Datagrid.SetCol(i);
m_Datagrid.SetRow(j);
sPrint=m_Datagrid.GetText();
}
}
给你参考一下