Example #1
0
 def add_column(self, HeaderText=None, Editable=False, checkbox=False):
     column = forms.GridColumn()
     if self.ShowHeader:
         column.HeaderText = HeaderText
     column.Editable = Editable
     if not checkbox:
         column.DataCell = forms.TextBoxCell(self.Columns.Count)
     else:
         column.DataCell = forms.CheckBoxCell(self.Columns.Count)
     column.Sortable = True
     self.Columns.Add(column)
Example #2
0
 def create_checkbox_column(index):
     try:
         # check box delegates
         def rowvalues_get_check_delegate(row_values):
             return row_values.GetItemDataAt(index)
             
         def rowvalues_set_checked_delegate(row_values, check):
             row_values.SetItemDataAt(index, check)
             #for test log:
             #print row_values.GetItemDataAt(0) + " ckeckbox is now set to " + \
                 #str(row_values.GetItemDataAt(index))
                 
         #column with check boxes creation
         column = forms.GridColumn(
                     DataCell = forms.CheckBoxCell(
                     Binding = forms.Binding.Delegate
                      [RowValues, System.Nullable[System.Boolean]]
                       (rowvalues_get_check_delegate, 
                        rowvalues_set_checked_delegate)))         
     except Exception as e:
         print e                      
     return column