How to make grid control editable?

I don't know how to  edit each cells in the Flexgrid control and save those new data, please help!

Thanks.
Hanqian
HanqianAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AlexFMCommented:
0
Amritpal SinghCommented:
0
HanqianAuthor Commented:
Hi AlexFM,

The first sample is the one what I want, but I couldn't figture out how to save the data of each cell, I need to save all the cell's data
when exits from this window.

Thanks.
Hanqian
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

AlexFMCommented:
Both links are about same control, second shows how combo box can be embedded to grid.

Code fragments from my project:

        // read grid control
        int n = m_pGrid->GetRowCount();   // m_pGrid is pointer to grid control
        CString s;

        for ( int i = 1; i < n-1; i++ )   // read all rows
        {
              s = pGrid->GetItemText(nRow, 0);    // get text from line i, column 0
              // do something with s, read other columns etc.
              ...
        }

I am using this control in my project, and I think this is great control. It takes some time to learn it, but all grids are complicated.
0
AlexFMCommented:
BTW, I don't remember why i is changed from 1 to n-2 and not from 0 to n-1, but this is old project. I guess it should be

for ( int i = 0; i < n; i++ )  
0
HanqianAuthor Commented:
Hi AlexFM,

It is great, I know how to save data for text. If cell type is check box, how to save it?

Thanks.
Hanqian

0
AlexFMCommented:
I didn't use checkbox, you need to search in Grid control documentation. In this situation I used embedded combobox with "Yes" and "No" items. After editing grid cell contains "Yes" or "No" text which can be extracted by GetItemText. Try to ask in the article discussion area.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
HanqianAuthor Commented:
Hi AlexFM,

Thanks for your help, I get the answer about check box from your reference.

Hanqian
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.