Colleagues,
I need to have a Grid.Column(m.I).Header1.Click event programmed. Therefore, SetAll method won't do coz it sets property value, not event. That Header1.Click() event code shall set the bound table's index order to the corresponding field's index tag.
The problem is - I dunno how many columns this grid will have on run time, neither the Columns' fields' names: I set the Grid.RecordSource dynamically, at run time, after the User selects the table in the File/Open dialog.
All I know is that the table will have an index tag named the same as the field's name (i.e. field "Tax_Code" will have the index tag "Tax_code").
I could've solved this problem by creating this grid at design time with assuredly excessive number of columns, with Column.Header1.Click() pre-programmed.
Then, after the User have the table selected, bind the latter, field-by-field, to the columns sequentially, and delete the un-used columns.
I did it in the past, but that was quite a tedious and (sigh of shame!) messy job, let alone time-consuming. (Making a custom Column object by sub-classing the basic Column ain't appealing either: it still requires a lot of coding for the run-time dynamic table-to-grid column-by-column binding. :-( )
Is there any other solution, more elegant and less time-consuming?
TIA!
Regards,
Ilya
I need to have a Grid.Column(m.I).Header1.Click event programmed. Therefore, SetAll method won't do coz it sets property value, not event. That Header1.Click() event code shall set the bound table's index order to the corresponding field's index tag.
The problem is - I dunno how many columns this grid will have on run time, neither the Columns' fields' names: I set the Grid.RecordSource dynamically, at run time, after the User selects the table in the File/Open dialog.
All I know is that the table will have an index tag named the same as the field's name (i.e. field "Tax_Code" will have the index tag "Tax_code").
I could've solved this problem by creating this grid at design time with assuredly excessive number of columns, with Column.Header1.Click() pre-programmed.
Then, after the User have the table selected, bind the latter, field-by-field, to the columns sequentially, and delete the un-used columns.
I did it in the past, but that was quite a tedious and (sigh of shame!) messy job, let alone time-consuming. (Making a custom Column object by sub-classing the basic Column ain't appealing either: it still requires a lot of coding for the run-time dynamic table-to-grid column-by-column binding. :-( )
Is there any other solution, more elegant and less time-consuming?
TIA!
Regards,
Ilya