My dbgrid will have 1 column. I want to size tha column to the whole width of the dbgrid.
How can this be accomplished at run time?
I tried dbgrid.DefColWidth = dbgrid.width, but it doesn't seem to do anything..
Thanks,
Dan
Printable View
My dbgrid will have 1 column. I want to size tha column to the whole width of the dbgrid.
How can this be accomplished at run time?
I tried dbgrid.DefColWidth = dbgrid.width, but it doesn't seem to do anything..
Thanks,
Dan
If your dbgrid only has one column, why not just use a databound list box? then you can resize it to whatever you want. if you're hiding fields on the fly, i could understand that. is that it?
-chuck
Yes, I'm just showing 1 column.. But can I add/delete records through the Datalist like I can through the dbgrid? Is it done in the same manner or does it require additional code?
Thanks for any help you can provide..
Dan
Good point. No, you can't edit data the same. You would have to either pop up an inputbox (inputbox() function) to get the data or have a textbox nearby that you could populate with the currently selected item for changing.
Note that you can't set a column's width property equal to the grid's width property because the grid must surround the column, so it must be bigger. try making the column a little smaller than the grid and see if that works.
i can't offer much more help than that. sorry.:-(
-chuck