Hi, everyone.
I got a weird problem for my C# program. In my program, I use a DataGrid to display data. I bind the DataGrid to a DataTable. I made all the cells in DataGrid ReadOnly as True. So I can only Click on the cell but not change them.
Now, after I display the data, I clicked on one cell, then I clicked a button which will *virtually* go to the other form.(The reason why I said *virtually* is because I only use one form for the whole program. Every time I hit a button, according to the Caption shown on the button, i will hide some content in the form, and display some contents. So it looks like we are going to different forms, but actually we only got one form in total).
Back to the problem, After I *virtually* exit the data display form, I click a button to re-enter to data display form which will request me to type username and password to show the data. Before I entered username and password, the DataGrid area should appear purely blank, just as first time coming in. But what I actually got is the cell i clicked before appeared in the DataGrid area, and only that cell!
I tried to use DataGrid.DataSource = Null to clear the DataGrid, but it didn't work. I even tried to do ((DataTable)DataGrid.DataSource).Clear() before I dereference the DataSource from DataGrid, it still didn't work. Anyone got an idea of it?
PS: Sorry for my long post, and since i couldn't figure out which part got wrong, so i couldn't post the code coz it's too long.