Click to See Complete Forum and Search --> : DataGrid with ADO
leogrimberg
October 4th, 2000, 08:47 AM
Help me ! . I'm trying to use ADO DataGrid control in VC++ and I canīt find the way of formating each column (header, length, etc.).
The control properties only let me set two columns.
jim enright
October 6th, 2000, 04:36 PM
i am assuming that you are using the ms grids that come with the vc++ package. if so you may be in a bit of trouble as i have found a number of bugs and limitations. as far as formaatting you may have to do that yourself outside the control, e.g. something like the following would format a number to 2 decimal places:
double x;
CString s;
x = 123.4567;
s = s.Format("%6.2f",x);
DBGrid1.SetRow(1);
DBGrid1.SetCol(1);
DBGrid1.SetText(s);
you would have to go throught the conversion from string to double to get data out of a grid cell.
dfwade
October 7th, 2000, 09:04 AM
you can use the columnheader.add and set the width and title. But, you have to do it after you set the datasource of the grid
TANSTAAFL - There ain't no such thing as a free lunch
mysurface
October 12th, 2000, 05:22 AM
If u are using VC 6,
u can try use Active X of
ADO data control, and OLE DataGrid
this only available in vc6
I am not working on it.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.