Clever DataGrid Column Frustration

Hi,
I have read every possible thread about creating customer catagrid columns that inherit DataGridTextBoxColumn but nowhere can I find the answer to my problem.

I inherit a DataGridTextBoxColumn to implement a lookup of a sub object property so my grid can bind to, say, a Customers collection and see Customer Name and Customer PostCode where PostCode is a property of a sub object Address.  Ok, now I can manage all that but where I am completely out of ideas and going very, very crazy is when and how are these columns painted!

To simplify my problem if I add a column that 'appears' to have an invalid MappingName how and where can I access it to draw it.

        Dim cs As xxDataGridTextBoxColumn = New xxDataGridTextBoxColumn
        cs.MappingName = "Customer.Address.Postcode"
        ts1.GridColumnStyles.Add(cs)

I can see the column exists in my paint events for other valid (ie. simple) MappingNames and I can access the data through overriding the GetColumnValueAtRow and using reflection but I cannot for the life of me track down which event decides not to attempt to draw this column.

Please, please give me any pointers.


Answer this question

Clever DataGrid Column Frustration

  • Clever DataGrid Column Frustration