Aug-30-2019, 11:04 AM
(This post was last modified: Aug-30-2019, 11:04 AM by BollerwagenIng.)
Hello,
I crate a DataGrid and I want to insert for every row in the third column a ComboBox. I am so far til now:
I crate a DataGrid and I want to insert for every row in the third column a ComboBox. I am so far til now:
def getUIContent(): my_toolProperty = sdk.ToolPropertyContainer() # Define UI my_toolProperty.ToolPropertyContent = getCustomToolPropertyContent() # Update Grid UpdateDataGridData() return my_toolProperty def getCustomToolPropertyContent(): # Create a Grid my_Grid = WPFControls.Grid() # Add 1 Row and One Column my_Grid.RowDefinitions.Add(WPFControls.RowDefinition()) my_Grid.ColumnDefinitions.Add(WPFControls.ColumnDefinition()) # Create a DataGrid global myDataGrid myDataGrid = WPFControls.DataGrid() # global myComboBox myComboBox = WPFControls.DataGridComboBoxCollumn() # Add the DataGrid to the Grid my_Grid.Children.Add(myDataGrid) # Return the Grid return my_Grid # def UpdateData (it's only the Path of api / not important) @apex_sdk.errorhandler def UpdateDataGridView(): # Retrieve grid results grid = sdk.getScriptFunctionReturnData() # Create table data_table = WPFData.DataTable("Contents") data_table.Columns.Add("Prename") data_table.Columns.Add("Last Name") # Add data to the table for each name parts = grid['Name'] for name in names: data_table.Rows.Add(part['prename'], part['lastname']) # Set the IetmsSource for the data grid to the DataTable myDataGrid.ItemsSource = data_table.DefaultView # myDataGrid.ItemsSource = myComboBox ??? # Position the DataGrid in the first row, column of the Grid WPFControls.Grid.SetRow(myDataGrid, 0) WPFControls.Grid.SetColumn(myDataGrid, 0)