Creating Grid
Emanuele Croci
Dear all,I need to create a grid in a form.
I need to create each column of the grid, not using a query.
Initially, The grid must be empty.
The first field should be a combo-box where I can select some defined values.
The second field must be a normal textbox.
How can create this grid?
Can someone help me, please?
Regards
Emanuele
Emanuele Croci
I did it!!!....
....
SwissAddonFramework.UI.Components.Grid myGrid = SwissAddonFramework.UI.Components.Grid.CreateNew("TC_Grid");
myGrid.FromPane = 77;
myGrid.ToPane = 77;
myGrid.Left = 50;
myGrid.Top = 50;
myGrid.Width = 300;
myGrid.Height = 300;
newForm.AddItem(myGrid);
...
...
string query = @"SELECT T0.U_field1 as 'field1', T0.U_field2 as 'field2', T0.U_field2 as 'field3' FROM [dbo].[@TCPROVACUSTOM] T0 ";
myGrid.ExecuteQuery(query);
myGrid.AffectsFormMode = false;
myGrid.Columns["field1"].Editable = false;
myGrid.Columns["field2"].Editable = true;
myGrid.Columns["field2"].Type = GridColumn.Types.ComboBox;
((ComboBoxGridColumn)myGrid.Columns["field2"].SpecificGridColumn).ValidValues.Add("C", "C - Value");
((ComboBoxGridColumn)myGrid.Columns["field2"].SpecificGridColumn).ValidValues.Add("S", "S - Value");
((ComboBoxGridColumn)myGrid.Columns["field2"].SpecificGridColumn).ValidValues.Add("L", "L - Value");
myGrid.Columns["field3"].Editable = true;
ChooseFromList.DefaultSQLQuery queryDef = new ChooseFromList.DefaultSQLQuery("SELECT CardCode, CardName FROM OCRD");
ChooseFromList cfl = new ChooseFromList(queryDef, "CardName", true, false, myGrid, "field3");
cfl.ChooseFromListEvent += new ChooseFromList.ChooseFromListHandler(cfl_ChooseFromListEvent);
newForm.Update();
...
Thank you.
Regards
Emanuele
0
Please sign in to leave a comment.
Comments
0 comments