I have a DataGrid control that I populate by binding it to an ArrayList.
The ArrayList contains objects of a class I created with several public
properties exposed to populate the respective columns.



I have two questions regarding this DataGrid control:

1.) There is an automatically-generated column along the left-hand side of
the DataGrid which is apparently provided to enable row selection. It
contains a little triangle to mark the currently-selected row. How can I
control the width of that column? (I don't know if it is even called a
"column", but I don't know what else to call it.)

2.) I am doing all formatting programmatically by creating a
DataGridTableStyle then creating each column respectively via
DataGridTextBoxColumn objects, etc. Finally, this new TableStyle, ts, is
added via myDataGrid.TableStyles.Add(ts); Whereas I am able to set the
font for the Header in this scenario (ts.HeaderFont), I have not found a way
to set the font for normal rows? If I try to set the font via the
DataGrid.Font property (after the above DataGridTableStyle is set), my font
specification seems to be outright ignored. How should I do this?



Cheers, Bruce

Re: DataGrid Formatting Question by Dmitriy

Dmitriy
Mon Nov 10 04:50:21 CST 2003

Hi Bruce,

> 1.) There is an automatically-generated column along the left-hand side
of
> the DataGrid which is apparently provided to enable row selection. It
> contains a little triangle to mark the currently-selected row. How can I
> control the width of that column? (I don't know if it is even called a
> "column", but I don't know what else to call it.)

This thing is called "row header". I believe there's a property to control
its width either on the DataGrid class itself or on the DataGridTableStyle
class and this property should be called something like "RowHeaderWidth".

> 2.) I am doing all formatting programmatically by creating a
> DataGridTableStyle then creating each column respectively via
> DataGridTextBoxColumn objects, etc. Finally, this new TableStyle, ts, is
> added via myDataGrid.TableStyles.Add(ts); Whereas I am able to set the
> font for the Header in this scenario (ts.HeaderFont), I have not found a
way
> to set the font for normal rows?

Does the DataGridTableStyle expose a Font property? If yes, use this one. If
no, hmm..., this sounds strange as I remember I had no problem with
customizing the grid content font.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Bruce Schechter" <bruce@coding-r-us.com> wrote in message
news:ub%23zBL2pDHA.3320@tk2msftngp13.phx.gbl...
> I have a DataGrid control that I populate by binding it to an ArrayList.
> The ArrayList contains objects of a class I created with several public
> properties exposed to populate the respective columns.
>
>
>
> I have two questions regarding this DataGrid control:
>
> 1.) There is an automatically-generated column along the left-hand side
of
> the DataGrid which is apparently provided to enable row selection. It
> contains a little triangle to mark the currently-selected row. How can I
> control the width of that column? (I don't know if it is even called a
> "column", but I don't know what else to call it.)
>
> 2.) I am doing all formatting programmatically by creating a
> DataGridTableStyle then creating each column respectively via
> DataGridTextBoxColumn objects, etc. Finally, this new TableStyle, ts, is
> added via myDataGrid.TableStyles.Add(ts); Whereas I am able to set the
> font for the Header in this scenario (ts.HeaderFont), I have not found a
way
> to set the font for normal rows? If I try to set the font via the
> DataGrid.Font property (after the above DataGridTableStyle is set), my
font
> specification seems to be outright ignored. How should I do this?
>
>
>
> Cheers, Bruce
>
>


Re: DataGrid Formatting Question by Ken

Ken
Mon Nov 10 20:40:43 CST 2003

Hi,

1) http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q868q

2) http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q927q

Ken
--------------------
"Bruce Schechter" <bruce@coding-r-us.com> wrote in message
news:ub%23zBL2pDHA.3320@tk2msftngp13.phx.gbl...
> I have a DataGrid control that I populate by binding it to an ArrayList.
> The ArrayList contains objects of a class I created with several public
> properties exposed to populate the respective columns.
>
>
>
> I have two questions regarding this DataGrid control:
>
> 1.) There is an automatically-generated column along the left-hand side
of
> the DataGrid which is apparently provided to enable row selection. It
> contains a little triangle to mark the currently-selected row. How can I
> control the width of that column? (I don't know if it is even called a
> "column", but I don't know what else to call it.)
>
> 2.) I am doing all formatting programmatically by creating a
> DataGridTableStyle then creating each column respectively via
> DataGridTextBoxColumn objects, etc. Finally, this new TableStyle, ts, is
> added via myDataGrid.TableStyles.Add(ts); Whereas I am able to set the
> font for the Header in this scenario (ts.HeaderFont), I have not found a
way
> to set the font for normal rows? If I try to set the font via the
> DataGrid.Font property (after the above DataGridTableStyle is set), my
font
> specification seems to be outright ignored. How should I do this?
>
>
>
> Cheers, Bruce
>
>



Re: DataGrid Formatting Question by dearpolycarp

dearpolycarp
Tue Nov 11 08:27:02 CST 2003

Dynamic sizing with percentagles, min col widths, for WinForm DataGrids
Free : http://www.c-sharpcorner.com/Code/2003/Nov/DynamicDataGrid.asp

"Ken Tucker [MVP]" <vb2ae@bellsouth.net> wrote in message news:<udzRH5$pDHA.3256@tk2msftngp13.phx.gbl>...
> Hi,
>
> 1) http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q868q
>
> 2) http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q927q
>
> Ken
> --------------------
> "Bruce Schechter" <bruce@coding-r-us.com> wrote in message
> news:ub%23zBL2pDHA.3320@tk2msftngp13.phx.gbl...
> > I have a DataGrid control that I populate by binding it to an ArrayList.
> > The ArrayList contains objects of a class I created with several public
> > properties exposed to populate the respective columns.
> >
> >
> >
> > I have two questions regarding this DataGrid control:
> >
> > 1.) There is an automatically-generated column along the left-hand side
> of
> > the DataGrid which is apparently provided to enable row selection. It
> > contains a little triangle to mark the currently-selected row. How can I
> > control the width of that column? (I don't know if it is even called a
> > "column", but I don't know what else to call it.)
> >
> > 2.) I am doing all formatting programmatically by creating a
> > DataGridTableStyle then creating each column respectively via
> > DataGridTextBoxColumn objects, etc. Finally, this new TableStyle, ts, is
> > added via myDataGrid.TableStyles.Add(ts); Whereas I am able to set the
> > font for the Header in this scenario (ts.HeaderFont), I have not found a
> way
> > to set the font for normal rows? If I try to set the font via the
> > DataGrid.Font property (after the above DataGridTableStyle is set), my
> font
> > specification seems to be outright ignored. How should I do this?
> >
> >
> >
> > Cheers, Bruce
> >
> >

Re: DataGrid Formatting Question by dearpolycarp

dearpolycarp
Tue Nov 11 08:28:34 CST 2003

http://www.c-sharpcorner.com/Code/2003/Nov/DynamicDataGrid.asp

"Bruce Schechter" <bruce@coding-r-us.com> wrote in message news:<ub#zBL2pDHA.3320@tk2msftngp13.phx.gbl>...
> I have a DataGrid control that I populate by binding it to an ArrayList.
> The A