VB.NET - DataGridTextBoxColumn (GridColumnStyle)

Asked By Jerry Laudat on 08-Jun-06 08:21 PM
My computer seems to be acting flaky as usual. This is the third time that I've had a problem with datagrid Tablestyles even though the same code WAS ORIGINALLY WORKING FINE.

Let me describe this third problem.  When the user clicks an Exit button, I would check to see if he had dragged wider any of the datagrid columns. To do this, I would compare the previous value of 
	 DataGridTextBoxColumn.Width    (check this for each column)
To its current value. If the value had changed, I would remind the user that he just changed the column width and ask him if he wanted to retain this width permanently. 

This was working fine and then suddenly stopped working. Now, when I step thruogh the code when the Exit button is clicked as before, the value
	 DataGridTextBoxColumn.Width
remains the same even if the user widened the columns. It never changes. This is crazy!  So I (supposedly) found a different way to detect when the user has widened the columns.  When I create the TableStyle at the outset, I add the following handler:
	AddHandler DataGridTextBoxColumn.WidthChanged, AddressOf DataGridTextBoxColumn_WidthChanged
But this handler never fires, no matter how many times the user widens the columns. 

Has anyone else run into this? Or know a solution?

Have you tried just altering the - Asked By Robbe Morris on 08-Jun-06 08:45 PM

currentcell's properties instead of grabbing an instance of the specific cell type?

Pr oblem solved - Asked By Jerry Laudat on 09-Jun-06 02:45 AM

My code sets up the mapping names for each datagridtextboxcolumn. However, somehow I deleted the following line without realizing it:

TablesTyle1.MappingName = dt.TableName

I spent the whole evening working on this before I finally caught the error. Bummer. 

Thanks anyway.