Objective Grid: Deferred binding to a recordset

Article ID: 366
Last updated: 27 Apr, 2018
Article ID: 366
Last updated: 27 Apr, 2018
Revision: 3
Views: 1758
Posted: 24 Jan, 2001
by Meltreger B.
Updated: 27 Apr, 2018
by Meltreger B.

Problem

 


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?

 

 


Cause

 


 

 


Action

 


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);
__super::OpenRecordset();
}

This article was:   Helpful | Not helpful
Report an issue
Article ID: 366
Last updated: 27 Apr, 2018
Revision: 3
Views: 1758
Posted: 24 Jan, 2001 by Meltreger B.
Updated: 27 Apr, 2018 by Meltreger B.

Others in this category