Mehmet Emin Posted July 11, 2020 Posted July 11, 2020 How Can I auto size TUnimDBGrid column to available space or something like flex? I want my last column to fit available space. I could do it in the desktop components. But it's not possible in mobile. Thank you
Sherzod Posted July 16, 2020 Posted July 16, 2020 On 7/12/2020 at 2:36 AM, Mehmet Emin said: I want my last column to fit available space. Hello, Can you try this approach? procedure TMainmForm.UnimFormReady(Sender: TObject); begin with UnimDBGrid1 do JSInterface.JSCall('setFlex', [1], Columns[Columns.Count-1].JSColumn); end;
Mehmet Emin Posted July 16, 2020 Author Posted July 16, 2020 Thank you. This solved my issue with mobile grid.
Abaksoft Posted May 20, 2021 Posted May 20, 2021 in Build 1549, If you want to forcefit equal width colums, this is not functional : procedure TMainmForm.UnimFormReady(Sender: TObject); begin UnimDBGrid1.JSInterface.JSCall('setFlex', [1], Columns[0].JSColumn); UnimDBGrid1.JSInterface.JSCall('setFlex', [1], Columns[1].JSColumn); end; Use instead this : procedure TMainmForm.UnimFormReady(Sender: TObject); begin UnimDBGrid1.JSInterface.JSConfig('width', ['50%'], dbg.Columns[0].JSColumn); UnimDBGrid1.JSInterface.JSConfig('width', ['50%'], dbg.Columns[1].JSColumn); end;
Mehmet Emin Posted May 20, 2021 Author Posted May 20, 2021 I am on version 1.90.0.1549 and using setFlex for the last columns of my grids still working. But I will use your approach if need equal fit of the columns. So thanks for the tip
55143681 Posted June 11, 2021 Posted June 11, 2021 On 7/16/2020 at 12:58 PM, Sherzod said: Hello, Can you try this approach? procedure TMainmForm.UnimFormReady(Sender: TObject); begin with UnimDBGrid1 do JSInterface.JSCall('setFlex', [1], Columns[Columns.Count-1].JSColumn); end; For cbuilder: void __fastcall TMainmForm::UnimFormReady(TObject *Sender) { UnimDBGrid1->JSInterface->JSCall("setFlex","1",UnimDBGrid1->Columns->Items[UnimDBGrid1->Columns->Count-1]->JSColumn) ; }
Recommended Posts