[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to make grid control editable?

Posted on 2004-11-24
9
Medium Priority
?
175 Views
Last Modified: 2013-11-20
I don't know how to  edit each cells in the Flexgrid control and save those new data, please help!

Thanks.
Hanqian
0
Comment
Question by:Hanqian
  • 5
  • 3
9 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 12668267
0
 
LVL 6

Expert Comment

by:Amritpal Singh
ID: 12672293
0
 

Author Comment

by:Hanqian
ID: 12696750
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 48

Expert Comment

by:AlexFM
ID: 12696952
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
 
LVL 48

Expert Comment

by:AlexFM
ID: 12696981
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
 

Author Comment

by:Hanqian
ID: 12697027
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
 
LVL 48

Expert Comment

by:AlexFM
ID: 12697120
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
 
LVL 48

Accepted Solution

by:
AlexFM earned 1000 total points
ID: 12697167
0
 

Author Comment

by:Hanqian
ID: 12697481
Hi AlexFM,

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

Hanqian
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question