I want to be able to attach a recordset to a bound grid after calling OnInitialUpdate and start with an empty grid? Is this possible?
Yes. Simply don't call SetRecordset(pRecordset) before calling OnInitialUpdate. If the grid has no pointer to a recordset, it will not try to open the set.
Later, when you want to attach a recordset, you should call SetRecordset() and OpenRecordset().
Example:
void CMyGrid::OnAttachRecordset()
{
m_pSet = new CRecordset;
SetRecordset(m_pSet);
CGXDaoGrid::OpenRecordset();
}
NOTE: Make sure you have OG 5.01 when using this solution. With previous releases you will get an ASSERT.