Solved

How to create grid control in Visual C++?

Posted on 2002-05-20
3
851 Views
Last Modified: 2011-10-03
Greetings!

I want create a "Grid control" where I can edit every fiald but without any Database features. I saw it in Delphi and VB but cannot find in VC++.


I found that I can create something like this by using a CListCtrl but there I can edit items only from the first column. I want to be able to edit them all.

How can I do it?

Thank you in advance!
0
Comment
Question by:Masonok
  • 2
3 Comments
 
LVL 4

Expert Comment

by:IainHere
ID: 7021205
Well, if the control is an activeX control, you can use it in VC++ if you want.

If you have a listcontrol, you can enable full row select like this:

SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
0
 
LVL 4

Accepted Solution

by:
IainHere earned 50 total points
ID: 7021221
If you want something a bit more feature rich, then you could do worse than look here for a start:

http://www.codeproject.com/miscctrl/gridctrl.asp

I tested this once (a few versions back) and it worked well.  I stuck with the CListCtrl though, because I trusted it more and I didn't need too much functionality.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7022764
I also recommend looking into that class; Chris Maunder usually writes some good code.

An alternative is to just use the MsFlexGrid ActiveX control (which does not support editing) but then apply the information here:

EditGrid.exe: Edit Cells in MSFlexGrid ActiveX Control (Q196833)

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q196833

...which will let your users edit individual cells in the grid.  It also provides a complete project source code which will show you how to implement the ActiveX.

-- Dan

0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now