Data Grid Column Size

  • Thread starter Thread starter Randyb
  • Start date Start date
R

Randyb

Is there any way to set the width of columns at design time for a datagrid
with two columns where the sizes are already known.

I have a bound grid with two columns I want the first one to be 30 and the
second to be 20 characters for display.

I have tried using the Example from .Net documentation for doing this at run
time with the DatGridTableStyle and the PreferredColumnWitdth (with no luck
;)). I do not get any errors but it does not set the size...

tia
RPB
 
You can do it with the designer but if you bind it afterward I think you'll
lose the formatting (i'm not positive but when I played with it i couldn't
get it to work unless I bound it to a Strongly Typed DataSet and specified
the column mappings in advance...

This article will help you though..
http://www.knowdotnet.com/articles/cgrid.html
 
Back
Top