When trying to set anything using datagridname.Columns(0) I get index out of range yet there are several rows with several columns showing. It works on other Datagrids in my project but not this one. Here is the code
Any clues?
Datagrid code:
sqltext = "
Select
(select name from stock where stockid=stock.id) as Name,
amount as Amount,
(select name from units where units.id=recipeparts.units) as Units,
units,
id
from recipeparts where recipeid=@param1 ORDER BY NAME;"
dt = QueryParam(sqltext, recipeid)
dgItems.ItemsSource = dt.DefaultView
'dgItems.Columns(0).Visibility = Visibility.Collapsed (error here when not commented out)
Any clues?