Gán và duyệt dữ liệu vòng lặp for C# | VN-Zoom | Cộng đồng Chia Sẻ Kiến Thức Công Nghệ và Phần Mềm Máy Tính

Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

We need money to operate the site, and almost all of it comes from our online advertising.

If possible, please support us by clicking on the advertisements.

Please add vn-z.vn to your ad blocking whitelist or disable your adblocking software.

×

Gán và duyệt dữ liệu vòng lặp for C#

XIn chào mọi người mình có 1 cái datagridview C# trong đó có các cột để mình duyệt qua và lấy dữ liệu giờ gán thế nào để nó tự động duyệt qua thứ tự như mình mong muốn là lần lượt từ displayindex từ 0,1 đến hết như đoạn code này
C#:
                grdRoom.Columns["Column1"].DisplayIndex = 0;
                grdRoom.Columns["Column2"].DisplayIndex = 1;
                grdRoom.Columns["Column3"].DisplayIndex = 2;
                grdRoom.Columns["Column4"].DisplayIndex = 3;
                grdRoom.Columns["Column5"].DisplayIndex = 4;
                grdRoom.Columns["Column6"].DisplayIndex = 5;
còn cái hình này nó duyệt đảo lộn. đoạn code trên gán vào đâu để nó nhảy vào cáo grdRoom.Column
grid.png
 


Top