MOGSY Posted September 17, 2020 Posted September 17, 2020 Hi How is possible to hide columns in UniDbGrid? I have tried the following and is not working. for II := 0 to unidbgrid.Columns.Count - 1 do begin if (unidbgrid.Columns.Items[II].FieldName = 'ABC') or (unidbgrid.Columns.Items[II].FieldName = 'EFG') then unidbgrid.Columns.Items[II].Visible := True else unidbgrid.Columns.Items[II].Visible := True; end; Thanks Quote
x11 Posted September 17, 2020 Posted September 17, 2020 9 minutes ago, MOGSY said: unidbgrid.Columns.Items[II].Visible := True else dbgAtoZ.Columns.Items[II].Visible := True; True or True? unidbgrid or dbgAtoZ ? Quote
irigsoft Posted September 17, 2020 Posted September 17, 2020 I Use this to create and setup Columns: MyColumn := TuniDBGrid (SelDBGrid).Columns.Add; MyColumn.Font.Size := uniMainModule.ControlsFontSize; MyColumn.Title.Font.Size := uniMainModule.ControlsFontSize; MyColumn.Title.Alignment := taCenter; MyColumn.Title.Caption := FieldsData [0]; MyColumn.Sortable := True; MyColumn.ReadOnly := True; MyColumn.ShowSummary := True; ------- --- this is it ------------------------ IF FieldsData.Count > 1 then begin if FieldsData [1] > '-1' then MyColumn.Width := StrToInt (FieldsData [1]) else MyColumn.Visible := False; end; I use file with settings for every grid and dinamically create it. If Lenght in file is biger of 0 then set up a column width from file else hide column. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.