dougconran
Technical User
I need to change the text displayed in a datagrid at the time of display.
I found an excellent articale at
explaining how I can do this by creating a binding event and then making the change within the binding_Format event.
Unfortunately the article describes how to do this for a textbox whereas I need to do it for a Datagrid and I can't work out what changes I need to make.
Currently I create a TableStyle in the form_load event and have the binding code within this - but it doesn't work
This is my code:-
I suspect that the binding statement is wrong but none of the variations that I can think of will work.
Can anyone suggest what I'm doing wrong?
TIA
Doug
I found an excellent articale at
explaining how I can do this by creating a binding event and then making the change within the binding_Format event.
Unfortunately the article describes how to do this for a textbox whereas I need to do it for a Datagrid and I can't work out what changes I need to make.
Currently I create a TableStyle in the form_load event and have the binding code within this - but it doesn't work
This is my code:-
Code:
Dim WithEvents obinding As Binding
...
...
...
BoolCol.HeaderText = "Compliant?" ' should display as Yes/No
obinding = New Binding("Text", DataSet11.welds.Columns(i), DataSet11.Tables(0).Columns(i).ColumnName) <-- I suspect this is wrong
DataGrid1.DataBindings.Add(obinding)
BoolCol.MappingName = DataSet11.Tables(0).Columns(i).ColumnName
tableStyle.GridColumnStyles.Add(BoolCol)
I suspect that the binding statement is wrong but none of the variations that I can think of will work.
Can anyone suggest what I'm doing wrong?
TIA
Doug