Click here to Skip to main content
15,913,487 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSetCheck() for checkbox in MFC GridControl 2.7 Pin
Anu_Bala21-Jan-19 18:16
Anu_Bala21-Jan-19 18:16 
Im using MFC GridControl 2.7 taken from code proejct in my application.In my grid control, im making second column as check box column. The default state of check box should be true. Later, user can uncheck the checkbox and depends on the state, furthur functinoality wil go. Here i dont know how to set checkbox as checked in default.

C++
m_ctLstCtrl.Create(listRect, this, IDC_TRENDLISTCTRL);

		// fill it up with stuff
		m_ctLstCtrl.SetEditable(TRUE);
		

		try {
			m_ctLstCtrl.SetRowCount(9);
			m_ctLstCtrl.SetColumnCount(15);
			m_ctLstCtrl.SetFixedRowCount(1);
			m_ctLstCtrl.SetFixedColumnCount(1);
			
		}
		catch (CMemoryException* e)
		{
			e->ReportError();
			e->Delete();
			return -1;
		}


for (int row = 0; row < m_ctLstCtrl.GetRowCount()-1; row++)
		{	
		m_ctLstCtrl.SetCellType(row+1,1,RUNTIME_CLASS(CGridCellCheck));
//		m_ctLstCtrl.SetItemState(row+1,1, m_ctLstCtrl.GetItemState(row+1,1) | GVIS_SELECTED);  //if i do this, blue colr selection is appearing but not check mark

		}

Anu

AnswerRe: SetCheck() for checkbox in MFC GridControl 2.7 Pin
Richard MacCutchan21-Jan-19 22:43
mveRichard MacCutchan21-Jan-19 22:43 
Questioncourse distribution system project in algorithm source code? Pin
Member 1412522921-Jan-19 10:07
Member 1412522921-Jan-19 10:07 
GeneralRe: course distribution system project in algorithm source code? Pin
David Crow21-Jan-19 10:27
David Crow21-Jan-19 10:27 
GeneralRe: course distribution system project in algorithm source code? Pin
CPallini21-Jan-19 10:35
mveCPallini21-Jan-19 10:35 
GeneralRe: course distribution system project in algorithm source code? Pin
Joe Woodbury21-Jan-19 10:37
professionalJoe Woodbury21-Jan-19 10:37 
AnswerRe: course distribution system project in algorithm source code? Pin
Stefan_Lang21-Jan-19 21:16
Stefan_Lang21-Jan-19 21:16 
QuestionChoosing my next Programming Language Pin
HS_C_Student21-Jan-19 2:49
HS_C_Student21-Jan-19 2:49 
AnswerRe: Choosing my next Programming Language Pin
Richard MacCutchan21-Jan-19 4:57
mveRichard MacCutchan21-Jan-19 4:57 
AnswerRe: Choosing my next Programming Language Pin
Joe Woodbury21-Jan-19 6:57
professionalJoe Woodbury21-Jan-19 6:57 
AnswerRe: Choosing my next Programming Language PinPopular
Stefan_Lang21-Jan-19 22:03
Stefan_Lang21-Jan-19 22:03 
GeneralRe: Choosing my next Programming Language Pin
Richard MacCutchan21-Jan-19 22:41
mveRichard MacCutchan21-Jan-19 22:41 
AnswerRe: Choosing my next Programming Language Pin
Member 1412742230-Jan-19 4:36
Member 1412742230-Jan-19 4:36 
QuestionOPC DA3 Pin
D.Manivelan20-Jan-19 22:21
D.Manivelan20-Jan-19 22:21 
AnswerRe: OPC DA3 Pin
Richard MacCutchan20-Jan-19 22:56
mveRichard MacCutchan20-Jan-19 22:56 
QuestionAdd checkbox in second column in dynamically created ListCtrl Pin
Anu_Bala20-Jan-19 18:19
Anu_Bala20-Jan-19 18:19 
AnswerRe: Add checkbox in second column in dynamically created ListCtrl Pin
Victor Nijegorodov20-Jan-19 20:45
Victor Nijegorodov20-Jan-19 20:45 
AnswerRe: Add checkbox in second column in dynamically created ListCtrl Pin
Richard MacCutchan20-Jan-19 21:24
mveRichard MacCutchan20-Jan-19 21:24 
QuestionHow to use Pin
Member 1412420320-Jan-19 15:46
Member 1412420320-Jan-19 15:46 
QuestionUsing hex in an array and "scanning" for it fails. Pin
Vaclav_20-Jan-19 14:51
Vaclav_20-Jan-19 14:51 
AnswerRe: Using hex in an array and "scanning" for it fails. Pin
Peter_in_278020-Jan-19 15:27
professionalPeter_in_278020-Jan-19 15:27 
GeneralRe: Using hex in an array and "scanning" for it fails. SOLVED Pin
Vaclav_20-Jan-19 16:57
Vaclav_20-Jan-19 16:57 
GeneralRe: Using hex in an array and "scanning" for it fails. SOLVED Pin
CPallini20-Jan-19 20:32
mveCPallini20-Jan-19 20:32 
GeneralRe: Using hex in an array and "scanning" for it fails. SOLVED Pin
Vaclav_21-Jan-19 6:42
Vaclav_21-Jan-19 6:42 
QuestionComplex multidimensional array in C++ Pin
Vaclav_19-Jan-19 18:27
Vaclav_19-Jan-19 18:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.