Setting Column Width in a DataGrid

Setting Column Width in a DataGrid

Post by TmlnZWwgRm » Thu, 03 Jun 2004 16:41:04


Hallo Everyone

I am having a problem setting the column width of DataGrid. I have tried 2 methods without success

Method 1
DtgAddresses.DataSource = dTabl
DtgAddresses.TableStyles(0).GridColumnStyles(0).Width =
DtgAddresses.TableStyles(0).GridColumnStyles(1).Width = 2
DtgAddresses.Refresh(

Method 2
In the properties of the datagrid under TableStyles and GridColumnStyles then setting the width property

Both methods seem to have absolutely no effect on the column width.. Ideally I would like to set one of my columns to 0 because I am using it to hold an database index

Any ideas

Nigel
 
 
 

Setting Column Width in a DataGrid

Post by Y. Sivara » Thu, 03 Jun 2004 17:01:19

Nigel,

Are you setting the mappingname property of the TableStyle object to the
data table name you are binding?

Also for your particular problem, I would suggest not adding the column to
the tablestyle grid column style, rather than hiding it.

--
Best Regards,
Y. Sivaram

Email:
XXXX@XXXXX.COM



methods without success.
then setting the width property.
Ideally I would like to set one of my columns to 0 because I am using it to
hold an database index.