Solved

How to create grid control in Visual C++?

Posted on 2002-05-20
3
857 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

733 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