delagoutte Posted December 3, 2020 Share Posted December 3, 2020 Hello, i would like change the editor control of columns in runtime. i do a simple test case : i add a unicheckcombobox in the hidden panel i add a radiogroup for switching the editor property for the column "city" between combobox and checkcombobox. -> if you select combox -> the editor for column city must be a combobox -> if you select Checkcombox -> the editor for column city must be a Checkcombobox but it is not work is there anyone that could said me why it is not working and how can ido for do this change of control on runtime ? GridEditors.zip Link to comment Share on other sites More sharing options...
Sherzod Posted December 3, 2020 Share Posted December 3, 2020 33 minutes ago, delagoutte said: -> if you select combox -> the editor for column city must be a combobox Hello, Link to comment Share on other sites More sharing options...
delagoutte Posted December 4, 2020 Author Share Posted December 4, 2020 hum, it seems working if the control are created on designtime but not if there is create in runtime. i'll do a test case Link to comment Share on other sites More sharing options...
delagoutte Posted December 4, 2020 Author Share Posted December 4, 2020 with this test case, change editor, and change value -> js error + if value is london -> checkbox with london value, is not checked .. many problem GridEditors_runtime.zip Link to comment Share on other sites More sharing options...
Sherzod Posted December 5, 2020 Share Posted December 5, 2020 18 hours ago, delagoutte said: with this test case, change editor, and change value -> js error + if value is london -> checkbox with london value, is not checked .. many problem Hi, Why are you creating editors dynamically every time? Link to comment Share on other sites More sharing options...
delagoutte Posted December 7, 2020 Author Share Posted December 7, 2020 i want that the user could choice the type of control for each column. the user could choice between combobox checkcombobox, checkbox, radiogroup, memo ....... i have 48 column for this grid, if i create them only on demand when it is necessary if think it is better than to have 48 combobox + 48 checkcombobox+48 checkbox+..... that are not realy used and after i must do the same thing for the filter contol!!!! Link to comment Share on other sites More sharing options...
delagoutte Posted December 9, 2020 Author Share Posted December 9, 2020 @Sherzod do you think there is a solution ? Do you recommend creating the components in design in my situation ? Link to comment Share on other sites More sharing options...
Sherzod Posted December 9, 2020 Share Posted December 9, 2020 42 minutes ago, delagoutte said: Do you recommend creating the components in design in my situation ? Hi, Probably not optimal, of course. Link to comment Share on other sites More sharing options...
delagoutte Posted December 10, 2020 Author Share Posted December 10, 2020 so, in my project i create all editor unicheckcombobox in designtime. if in designtime ,i set the editor to the control unicheckcombobox there is not error message. but if i set the editor to a combobox in designtime and after i change the control to the unicheckcomboboxcontrol i have problem : the value are not checked when the control display the dropdown list and when the value is set by the control i have this error message : Quote Uncaught TypeError: can't access property "attributes", m is null for change the control at runtime i use your method cureditor := TUniFormControl(GetControlByName(UpperCase(aGrid.Columns[i].FieldName),aTypeControl)); aGrid.Columns[i].Editor := cureditor ; aGrid.JSInterface.JSCall('setEditor', [TUniFormControl(cureditor).JSControl], aGrid.Columns[i].JSColumn); TUniFormControl(cureditor).JSInterface.JSAssign('valueField', ['val']); have you got an idea to fix this ? Link to comment Share on other sites More sharing options...
delagoutte Posted December 11, 2020 Author Share Posted December 11, 2020 @Sherzod hello, i do a test case joined to this message with control that exist on designtime but there is problem : Uncaught TypeError: can't access property "value", a.field is null Uncaught TypeError: can't access property "value", a.field is null GridEditors_change_editor.zip Link to comment Share on other sites More sharing options...
delagoutte Posted December 14, 2020 Author Share Posted December 14, 2020 So in my previous message, i said it works in runtime but it is false. could you check my last test case ? have you got an other solution ? Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now