Thursday, February 16, 2006

DisplayIndex trick.

I spent a couple of hours try to figure out a trick in DisplayIndex of the DataGridView. The trick is that I put the datagridview on a tab page of the tab control, however, when I selected the tab, the display index I set was invalidated. That means, it still shows the original display index, not the index I have set.

I have to put the display index set code in the Tab_SelectedIndexChanged event handler, and set it every time whne the tab is selected. It was not very efficient, but at leat it takes care of the issue.

Quite confusing.

No comments: