Mình muốn khi đưa dữ liệu vô datagirdview thì dư liệu sẽ dấu nháy sẽ ở cuối bảng để cho người dùng dễ thấy, ai bít giúp với?
Nguyên bản được gửi bởi hugo158 Mình muốn khi đưa dữ liệu vô datagirdview thì dư liệu sẽ dấu nháy sẽ ở cuối bảng để cho người dùng dễ thấy, ai bít giúp với? Bạn cho Code: gr.CurrentRow = gr.Rows[gr.Rows.Count+1]; gr.CurrentRow.Selected = true;
gr.CurrentRow = gr.Rows[gr.Rows.Count+1]; gr.CurrentRow.Selected = true;
Nguyên bản được gửi bởi linhgl88 Bạn cho Code: gr.CurrentRow = gr.Rows[gr.Rows.Count+1]; gr.CurrentRow.Selected = true; Nó bị lỗi ngay chổ : Code: gr.CurrentRow = gr.Rows[gr.Rows.Count+1]; gr.CurrentRow.Selected = true; [/QUOTE]
Nguyên bản được gửi bởi hugo158 Nó bị lỗi ngay chổ : Code: gr.CurrentRow = gr.Rows[gr.Rows.Count+1]; gr.CurrentRow.Selected = true; [/QUOTE] Có lẽ do chưa add thêm dòng mơi!!! hì, Bạn làm thế này thử!!! Code: gr.Rows.Add(1); gr.CurrentRow = gr.Rows[gr.Rows.Count-1]; gr.CurrentRow.Selected = true;
gr.Rows.Add(1); gr.CurrentRow = gr.Rows[gr.Rows.Count-1]; gr.CurrentRow.Selected = true;
Mình đã add rồi mà nó vẫn bị lỗi ngay chổ đó.
Nguyên bản được gửi bởi hugo158 Mình đã add rồi mà nó vẫn bị lỗi ngay chổ đó. Ấy dà!!! sr bạn nhen!!! Nãy h là do mình nghĩ thui!! chưa test thử. Hì Bàn làm thế này nè!!! Code: dataGridViewX1.CurrentCell = dataGridViewX1.Rows[dataGridViewX1.Rows.Count - 1].Cells[0]; dataGridViewX1.CurrentRow.Selected = true;
dataGridViewX1.CurrentCell = dataGridViewX1.Rows[dataGridViewX1.Rows.Count - 1].Cells[0]; dataGridViewX1.CurrentRow.Selected = true;
Nguyên bản được gửi bởi linhgl88 Ấy dà!!! sr bạn nhen!!! Nãy h là do mình nghĩ thui!! chưa test thử. Hì Bàn làm thế này nè!!! Code: dataGridViewX1.CurrentCell = dataGridViewX1.Rows[dataGridViewX1.Rows.Count - 1].Cells[0]; dataGridViewX1.CurrentRow.Selected = true; Cảm ơn bạn nhiều nha!
Tìm hiểu luật lệ tham gia diễn đàn