G
Guest
I have posted my question before. It seems that I can not find the solution.
The question:
I have datasource, say, ds which is bounded to a datagrid, dg.
Assume that ds have 5 columns, c0,c1,c2,c3,c4.
In some case, say, case 1, I want to display columns c0, c1,c2 in dg and use
c3 and c4 in code behind.
In case 2, I want to display column c0, c3, and c4, and use c1 and c2 in
code behind.
The following Possible solution do not work:
dg.Column(3).Visible = false.
My analysis from the test: dg.Column(3).Visible = false is only working for
those columns which are defined in design by DataGrid Property Builder. If
you populate a table to the datagrid via binding programmatically, it does
not work, at least in my computer.
Any good solution for it?
Thanks
David
The question:
I have datasource, say, ds which is bounded to a datagrid, dg.
Assume that ds have 5 columns, c0,c1,c2,c3,c4.
In some case, say, case 1, I want to display columns c0, c1,c2 in dg and use
c3 and c4 in code behind.
In case 2, I want to display column c0, c3, and c4, and use c1 and c2 in
code behind.
The following Possible solution do not work:
dg.Column(3).Visible = false.
My analysis from the test: dg.Column(3).Visible = false is only working for
those columns which are defined in design by DataGrid Property Builder. If
you populate a table to the datagrid via binding programmatically, it does
not work, at least in my computer.
Any good solution for it?
Thanks
David