Forum > Pas2JS

Column width with two WDataGrid. Pas2JS_Widget

(1/1)

rca:
I have a Button WButton1 and two DataGrids (WDataGrid1 and WDataGrid2).

I load the respective data in the procedure TWForm1.FormCreate


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---WDataGrid1.Data := jData1;WDataGrid2.Data := jData2;
And they work and display correctly.

I want to change the width of the first column of the WDataGrid2 with:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TWForm1.WButton1Click(Sender: TObject);begin  WDataGrid2.Columns[0].Width := 20;end;
However, it also affects the width of the first column of the WDataGrid1.

rca:
I attach a simple test program, which even if you only want to modify the width of the first column
of WDataGrid2, visually the same change is also reflected in WDataGrid1.

Please, can someone help me?

Navigation

[0] Message Index

Go to full version