DataGridView是从DataTable填充的:
DataTable dt = new DataTable();
dt = serviceSqlite.select();
dataGridView1.DataSource = dt;
select
方法在SELECT
中包含以下字段序列:
"Pacients.id, " +
"unique_code," +
"status_pass, " +
"payment, " +
"profession," +
"office_address, " +
"factory_name, " +
"factory_edrpou, " +
"factory_departament," +
"name, " +
"secondname, " +
"lastname, " +
"datebirth, " +
"taxcode, " +
"gender, " +
"Pacients.created_at, " +
"PacientsOrder.kind_work, " +
"PacientsOrder.status "
同样在DataTable的属性中,我移动列名如下:
为什么我在程序启动时在DataGridView中获取未排序的列?列的顺序不是我在属性中设置的。
答案 0 :(得分:0)
对{68F5E655-2E2D-492E-B445-BE1650AF5FAE}
列使用 Observable.fromFuture(it).onErrorResumeNext(Observable.empty())
,以特定顺序显示列。
在将SetOrdinal
绑定到DataTable
之前,请执行此操作。
例如:
DataTable
将其绑定到DataGridView
后,当您运行该应用程序时,您可以看到列显示为名称,国家/地区,大陆,地点。