Thread: Chapter 34 Ex.2
View Single Post
  #2 (permalink)  
Old April 3rd, 2013, 10:03 AM
Rod Stephens's Avatar
Rod Stephens Rod Stephens is offline
Wrox Author
Points: 3,166, Level: 23
Points: 3,166, Level: 23 Points: 3,166, Level: 23 Points: 3,166, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

I'm not sure I understand so let me know if this doesn't make sense.

It looks like you're creating an array with 5 values and passing it to a DataGrid that expects only 4 values. My guess is the DataGrid is ignoring the extra value because it doesn't know what to do with it.

Some controls like DataGrid are pretty "smart." They can do things like display named data values in particular fields. They know enough to ignore values that don't have names that they are interested in. For example, you could pass an Employee record to a DataGrid and it would display only the fields that it knew about. That would let you display only some of the data if you want to.

You might try putting the new data in one of the earlier array entries and see if it shows the new value and drops the last one.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)