grid control - tab styles

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have set the table and column style in the properties of the grid control, then I bind a Dataset to it, the grid show the dataset but the columns are not formatted with the column style, such as setting the width of the column

any help here would be appreciated

Thank
Steve
 
Maybe you forgot to add the tablestyle to your datagrid ? just a rough
guess..
yourDataGrid.TableStyles.Add(yourTableStyle);

Steve K said:
I have set the table and column style in the properties of the grid
control, then I bind a Dataset to it, the grid show the dataset but the
columns are not formatted with the column style, such as setting the width
of the column.
 
Post the code

--
Alex Feinman
---
Visit http://www.opennetcf.org
Steve K said:
I have set the table and column style in the properties of the grid
control, then I bind a Dataset to it, the grid show the dataset but the
columns are not formatted with the column style, such as setting the width
of the column.
 
There is no code to post, I set the properties in the properties window for the gridcontro

I then get a Dataset. fill it and then bind it to the grid control

what am I missing?
 
In that case post the code that is generated by designer - you will need to
expand the region called "Windows Form Designer generated code"
 
OK, I will look that code up and post it tonight

I have notices in the properties window I can have multiple Styles for a grid and each style has a collection of column styles, which style should the grid use? how does it know. I am missing something to tell the grid to use a style or is just creating a style enough? will it use the only one by default

Thank
Steve
 
here's the Code

'grdEquipmen

Me.grdEquipment.Location = New System.Drawing.Point(0, 16
Me.grdEquipment.Size = New System.Drawing.Size(240, 240
Me.grdEquipment.TableStyles.Add(Me.dgStyle1
Me.grdEquipment.Text = "DataGrid1

'dgStyle

Me.dgStyle1.GridColumnStyles.Add(Me.dgColumn1
Me.dgStyle1.MappingName = "Equip

'dgColumn

Me.dgColumn1.HeaderText = "BR
Me.dgColumn1.MappingName = "Branch
Me.dgColumn1.NullText = "(null)
Me.dgColumn1.Width = 2
 
OK, I just figured out what I was doing wrong

in the mapping name I was entering the name of the table from my select statement, the Dataset uses a default table name of "Table" once I placed this into the mapping name everything worked

Thanks for you help and patience
Steve
 
No problem

--
Alex Feinman
---
Visit http://www.opennetcf.org
Steve K said:
OK, I just figured out what I was doing wrong!

in the mapping name I was entering the name of the table from my select
statement, the Dataset uses a default table name of "Table" once I placed
this into the mapping name everything worked.
 
Back
Top