Default value in a column when using TableStyle in DataGrid?

  • Thread starter Thread starter Lars Netzel
  • Start date Start date
L

Lars Netzel

Is it possible to asign a default value to a cell in a DataGrid column when
using TableStyle as well?

I have an ID column with a width= 0 that has to have a default ID value when
the user adds rows in the datagrid.

/Lars
 
I used the NullText for this, although I'm not sure that's good if the
Column is not null and I still need it to be a defautl value

/Lars
 
Thankx, but can't use that I think.. I'm using three datagrids in a
master/detail way and Dataview to filter the content that I add as
datasource... and I need to set a new default value depending on what row is
selected in the grid above.

The Nulltext seemes to work from the ColumnStyle thingy!

/Lars
 
Hi Lars,

I misreaded your question 10 times I think. Probably because someone was
strange complaining yesterday in another newsgroup how to set the default
size of a column.

However why can you not set the default value of an underlaying datasource.
You are telling the default value from a datatable.column, not from the
item itself.

So when you have three tables with 1000 columns you can set every column/

If you do not understand it, ask again?

Cor
 
I have fixed it, thanx though!
Dim drCurrent As DataRowView = BindingContext(dvProjCodes).Current

DataGrid1.TableStyles.Item(0).GridColumnStyles(6).NullText =
drCurrent.Item("PRCO_ID")

/Lars
 
Back
Top