tags:

views:

51

answers:

1

I'm designing a MFC app in which I'd like to have a grid with 2 coloumns : both editable in which the user will input data and the app will get notified about it. The number of rows can be increased/decreased by the user as he wants - What would be the ideal MFC control to use for this kind of requirement ?

This is my first time designing a MFC app , so dont mind if it sounds too noobish :)

+3  A: 

It's not a noobish question. Actually you have encountered a problem which bugs every MFC developer since 15 years: The MFC library does not have a built-in Grid Control. And a kind of Grid Control is what you are looking for, I guess. As far as I'm aware of, it is not possible to edit two columns in a CListCtrl. Only the first column, the "Label", can be edited.

For a Grid control you have to look for appropriate Third-Party tools which can be added to your projects, for instance as ActiveX controls. (I remember that the old Visual Studio 6 came with an "MS FlexGrid" which you could add with the component gallery to the project, but I've never worked with it, so I don't know if it's a good choice. But perhaps enough for your purpose.) Most third-party Grid controls require license fees but here is one (quite powerful) grid for free (at least free of fees but not of a license):

http://www.codeproject.com/KB/miscctrl/gridctrl.aspx

(or google by "MFC Grid Control" or something like that. I think there will be more free grids.)

Slauma
Another free MFC grid control: http://www.codeproject.com/KB/MFC/UltimateGrid.aspx
adam
Problem is, I'm developing an internal tool to be used within the company - I don't think people will be happy with a tool using third-party code as it would require all kinds of licensing hassles. Unless that is, it is absolutely necessary - and its not, just that it'll make things a lot more intuitive for users of the app. Thanks for the response - saved me time hunting down something that doesn't exist in MSVC 8.0 !!
shan23
The license for the grids linked in my answer and in adam's comment is very generous ("The Code Project Open License (CPOL)": http://www.codeproject.com/info/cpol10.aspx). Actually I don't see any serious restrictions, neither in commercial nor internal nor open source projects. There is even not a need to tell your users that you are using these third-party tools. I'd install it together with your app (as part of your app) and that's it.
Slauma