srikadi
asked on
how to add CDialogTemplate to a CListview?
Hi,
how to add a CDilaogTempalte to a CListview.which contains buttons on top of CListctrl header.
that button action should perform some actioh in Clistctrl.
how to add a CDilaogTempalte to a CListview.which contains buttons on top of CListctrl header.
that button action should perform some actioh in Clistctrl.
ASKER
thanx for ur reply..
i did same thing but its not working properly..the listctrl is taking values but not showing to user..i don't know what could be the problem..
i did same thing but its not working properly..the listctrl is taking values but not showing to user..i don't know what could be the problem..
How do you add values to the list control? (Check it is in report mode - I assume you want columns of information).
ASKER
ya..its in report mode..when i scan the node the values comes to the CListctrl..before it has worked fine..but when i placed on formview its not working..i know its taking values adding to the database but not showing in Clistctrl..
that y i asked some other alternate solution......
that y i asked some other alternate solution......
Please show your code for adding the info to the list control.
ASKER
BeginWaitCursor();
CDatabase * commonDatabase = CTresManApp::GetDatabaseOb
ErrorRepository errorRep(commonDatabase);
//get the filter (if any) from the network tree. If no filter is available, then
//the whole NodeList table is considered when generating the task list table contents
// CString taskFilter = m_nwSplitter.GetNwTreeFilt
CString taskFilter = m_nwSplitter2.GetNwTreeFil
//fill database with scan tasks
TaskListDbHandler::Instanc
CTresManApp * pApp = (CTresManApp *)AfxGetApp();
ASSERT(pApp);
/**/CTaskFormView * pNwVList1 = (CTaskFormView *)m_nwSplitter2.GetPane(2,
CTaskListView * pNwVList=(CTaskListView *)pNwVList1->GetTaskListVi
ASSERT(pNwVList);
/* CDbView * tskvw = (CDbView *) pApp->GetView(CTresManStat
ASSERT(tskvw);
//set the dirty flag for the recordset. Recordset will be requeryd. This one is for the TaskList view
if (tskvw)
{
tskvw->SetRecordsetDirty()
}*/
if (pNwVList)
{
pNwVList->SetRecordsetDirt
}
EndWaitCursor();
before the code was with CListview..now i changed to CFormview..
Where is the list control?
ASKER
CTaskListView is the Clistctrl so..presently i am getting data to this CTaskListView .so i am calling this in CTaskFormView which is CFormview class.
Is pNwVList non NULL ?
Are you getting any records back from the database ?
What is the code in SetRecordsetDirty ?
Are you getting any records back from the database ?
What is the code in SetRecordsetDirty ?
ASKER
yes..iam getting records..
You have still not posted the code that is for adding the items to the list control.
Please confirm that CTaskListView is based on the CListCtrl class.
Please confirm that CTaskListView is based on the CListCtrl class.
ASKER
yes,CTaskListView is based on the CListCtrl class.
ASKER
sorry,CTaskListView is based on the CListView class
ASKER
if (!m_dSource.IsOpen())
{
return;
}
//if the recordset is empty, we display a notification label for the user
if (pItem->iItem == 0 && m_dSource.GetRecordCount()
{
if (pItem->iSubItem == m_firstVisibleColumn )
{
RemoveSelection();
pItem->pszText = (LPTSTR)(LPCTSTR)m_emptySt
}
return;
}
// called when the listview needs to display data
if(pItem->mask & LVIF_TEXT)
{
// first, move to the appropriate row in the database
CString itemText, itemTextTrunc;
if( m_dSource.PositionCursor(p
(m_dSource.GetValueByColNa
{
//if there is an index column, it is used for indexing the displayed items
//this is used only for the first column item because there's no reason to duplicate
//the information
//Truncate string if necessary.
if (itemText.GetLength() > pItem->cchTextMax)
{
CString itemTextTrunc;
itemTextTrunc.LoadString(I
int nTrunc = itemTextTrunc.GetLength() + 1;
itemText = itemText.Left(pItem->cchTe
}
lstrcpy(pItem->pszText, (LPCTSTR)itemText );
}
else
{
m_isRecordSetDirty = TRUE;
}
if (m_isRecordSetDirty)
{
SetRecordsetDirty();
m_isRecordSetDirty = FALSE;
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
sorry,i didn't get u..i don't have any resource dialog for Clistctrl..
Put the buttons where you want and a list control onto the dialog in the resource editor