Solved

How to create grid control in Visual C++?

Posted on 2002-05-20
3
854 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

776 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