|
I have used this grid as in splitter view as one of the four views.
And succesfully draw the grid inthat view,but iam unable to resize the cols and rows size by dragging the mousefrom the edge of the cell.
please help me.
Also I am unable to trap Mouse generated messages e.g. OnLButtonDown.
What happens is that the control always go to CGridCtrl's trapped message.
Please help me
leens
|
|
|
|
|
Hi Chris,
I've included your great control in my application and I've added a image (SetItemImage(..) call) to the cells. No problem until now, and it works fine in the debug build , but when I make a release build, my application crashes . If I don't set the image (no SetItemImage(..) call) my application also works fine in the release build.
I'm using VC++ 5.0 SP3
I realy like your control, perhpaps you or one of the other users has an idea for a workaround.
Ralph
|
|
|
|
|
I need to implement the following behaviour:
when the user clicks upon a cell, if certain condition is true,
a messagebox appears.
How ever, after the messagebox is closed, when moving the mouse over the
grid - the grid acts as in mode of "multiple selection" - like every cell
on which the mouse hovers - gets marked as "selected".
please help me to avoid this phenomena!
thank U, Eynat s.
|
|
|
|
|
I have the same problem and after your message I checked a little bit.
It seems that the variable CGridCtrl variable m_bLMouseButtonDown stays to TRUE when you click and open a MessageBox. I suppose that the LButtonUp event is lost or is sent to the messagebox instead. I have no fix now for this but maybe someone else will. Please help.
|
|
|
|
|
Good Afternoon,
On a right click, I want to make a dialog box appear, and allow them to make some choices based upon the row they are in.
What is the best way to do this?
Thanks!
Scott!
Put the big rocks in the glass jar first!
|
|
|
|
|
Hi,
I built up a project using the GridCtrl in a document/view architecture. Now I want to save all datas in the grid in a txt-File (ASCII). The serialize function only writes binary datas into the file. I want to know how to use the save and load function in the CGridCtrl-Class? Do I have to overload the Serialize-function? If yes...how??
Can anybody help me?
Thanks!
Carsten
|
|
|
|
|
Hi,
I'm a beginner in C++ programming and I want to use the Grid Control in my project. Now I want to save all datas in the Grid into an ASCII file. I already found the Save function in the CGridCtrl-Class, but I don't know how to use it with or without the serialize function in the CMyProjectDoc-Class.
Can anybody give me a hint?
Thanks!
Carsten
|
|
|
|
|
Hi Carsten,
try this:
void CMyProjectDoc::Serialize(CArchive& ar)
{
int nRows = 0, nCols = 0;
if (ar.IsStoring())
{
nRows = gridCtrl.GetColumnCount();
nCols = gridCtrl.GetRowCount();
ar << nRows << nCols;
for (int i = 0; i < nRows; i++)
{
for (int j = 0; j < nCols; j++)
{
ar << gridCtrl.GetItemText( i, j );
}
}
}
else
{
ar >> nRows >> nCols;
CString sItemText;
for (int i = 0; i < nRows; i++)
{
for (int j = 0; j < nCols; j++)
{
ar >> sItemText;
gridCtrl.SetItemText( i, j, sItemText );
}
}
}
}
Best regards
Holger
|
|
|
|
|
Hi,
When starting the application the created view is without the gridctrl showing although I know it is the right view that was created.
On any new documents created after that the view correctly displays the grid.
How can this be?
/Johannes Strömberg
|
|
|
|
|
Hi All,
I am using the Grid control in an SDI app to display
two sets of related data.
I am also using the Visual Framework to split the screen
into sections.
When I create a FormView and place the first grid control
in it, it will draw and operate perfectly ok.
BUT When I create a second formview, almost IDENTICAL code
no matter what I try, the grid control will not display!
I can tell that the control has been created correctly,
because my resizing routine makes it fit the window and
the scroll bars are active when the control does not fit
anymore. (This is made clearer since the working control
is the same size (But visible!) and directly above
the hidden control.
I figure I must be doing something REALLY simple wrong but
I have tried using WS_VISIBLE in the create, I have tried
creating a new class, I have tried using only the
Grid control directly (Which works!) But I would like
to define my own class and use the Grid control as the
base class.
Is it something about inheritence I have missed?
Any help on this would be IMMEASURABLY appreciated
Regards,
D
|
|
|
|
|
I put a GridCtrl in SDI Frame, in Debug ,It display normal,
but in Release Grid only display gridline,every Item can't display?
But I put this Release in Win98 ,It run very normal
|
|
|
|
|
I have to say it works fine for me under Win2K (SP1) in both debug and release...
|
|
|
|
|
i put the grid control in a property page. i also create a view and property sheet which hold the property page. all of this is in an extension dll. i have a strange problem when trying to create the page on win98. i get a blank page, even my ok and cancel buttons don't display. the tab is there but the page is completely blank.
now, in nt 4.0 i don't have this problem. anybody have some experience trying something like this?
mike
|
|
|
|
|
I have the same problem. Don't you know the solution please? I have a deadline... Thx a lot
|
|
|
|
|
My English is very pool,so i just to do it.
I have a problem,when V2.21 Grid Control in a Doc/View framework,I find a small rim around grid Control in frame? but In V2.20 is none,Why? How to wipe off it?
In Dialog App,V2.21 work is very normal.
I want everybody to help me! Thanks very much
|
|
|
|
|
Just after calling m_pGrid->Create(...), insert following lines, which removes the 'bordering' window styles
m_pGrid->ModifyStyle( WS_BORDER, 0 );
m_pGrid->ModifyStyleEx( WS_EX_CLIENTEDGE, 0 );
HTH,
Thomas
--
I am a signature virus!
Help me spread and copy me to your sig
|
|
|
|
|
Version 2.21 should fix the problems you are having - but I only have a W2K box to test on, so I can't be 100% (or even 50% ) sure.
cheers,
Chris Maunde
|
|
|
|
|
I got the demo to work by uncommenting 'Initialise();' in 'CGridCtrl::Create' and commenting out 'Initialise();' in 'CGridCtrl::PreSubclassWindow'
|
|
|
|
|
|
I experienced the same problems as the other posters, but found that if I added this code to my CMyApp::InitInstance function, the problems disappeared
if (!AfxOleInit())
{
AfxMessageBox(_T("Unable to initialize OLE"));
return FALSE;
}
This code should be called prior to the call to AfxEnableControlContainer() and before any AddDocTemplate calls.
|
|
|
|
|
Same problem with Peter and Mouez.
Chris if you have some time it would be great if could have a look on the view-sample. I have downloaded your 2.12 version and it works fine in my view!
A great job!
Ralph
|
|
|
|
|
Some problem with Peter.
But works fine in NT 4.0
Someone with an idea
|
|
|
|
|
I tried to run the "Grid in View" demo - without success.
The debug version crashes in CGridCtrl->Create(). The release version runs - the first view that is created by the app contains rubbish, if you click File->new a nice new view appears.
I tried to build the demo on w2k and win98 - same problems
|
|
|
|
|
Running the demo, after I changed the width of the column, I clicked the top cell of this column. This cell became a black box and the width of this box also is not correct.
What is the problem?
Tbanks,
Pete
|
|
|
|
|
Hi,
I did everything Chris did in this tutorial.
But my app (just fresh out of AppWizard) crashes
when I want to start it.
Also, what exactly is "m_pGridCtrl" in the
OnInitialUpdate handler ???
Any suggestions ?
Dennis Voss
|
|
|
|