Chap 17 Code1 CustomTable error
All,
Assuming these forums are still being looked at I felt it was important to point out some errors.
In the CustomTables.cs page (downloadable from this site) in the CreateChildControls function the two lines that read:
CreatBodyRow(useDataSource, rowIndex, iter.Current, dataRows);
CachePrimaryKey(useDataSource, iter.Current);
Need to be swapped.
When you run the code a very nice table appears similar to the GridView control with an Edit link for each line. If you select the Edit in the first line every field becomes editable, including the ID column. That's not supposed to happen. Clicking Edit in any other line works as expected. If you change to page two the same thing happens.
The problem here is a timing issue. By swapping those two lines it establishes the ID column and makes it ReadOnly before displaying it.
There is another problem dealing with Books.cs that I have put into another post and allows actually updating changes in the table.
Mark
|