Active Query Builder support area

When using CustomExpressionBuilder add a property that make the expression/criteria columns read only

Avatar
  • updated
  • Completed

Arrrggh :) This doesn't quite work but I though I would post it anyway as it might provoke a thought

In conjunction with my other two requests about editing SQL output columns with QT and exposing a cell reference in CustomExpressionBuilder so you know exactly which cell the ellipsis was clicked on.

Both of these requests could be 'avoided' if when using the CustomExpressionBuilder the Expression, Criteria and Or cells were all made 'read-only'

By that I mean you can click the ellipsis to launch a custom dialog to do what you like in, even provide a free type text box if one wishes but when the text is returned to the cell, if it is read only, You then know when the user next clicks on the ellipsis the OldExpression value will be as you set it i.e. they can't change it, the custom dialog is in total control

It doesn't get around one really needs to store some metadata to save having to 'reverse engineer' the OldExpression string to populate the custom dialog ..... but at least you would be in control of what you were reverse engineering

Thanks for listening !

Avatar
Andrew Kennard

Thanks for all your help and feedback on this

I would say the QT output columns is a separate issue although it might depend on what the solution is

For 'me' I think the easiest solution would be to have a string property that can be set/get in the CustomExpressionBuilder event

It could be called something like UserDefinedInfo or whatever

'You' would store this info against the Expression/Crirteria/Or cell and obviously 'you' are in control of whenever rows/columns are deleted.

For 'me' to be able to store this info against a cell as 'we' can now see I would need quite allot of index/references and events added to the control to keep everything synchronized ... which seems like a lot of work on both sides! :)

I still think there is a good case when using CustomExpressionBuilder that the Expression/Criteria/Or cells become read-only from the editing point of view ? If one really wants to one can always add a simple text fileld to a custom dialog to allow the user to free type criteria in as this would give the developer much more control

Let me know what you think and thanks again for the excellent communication!

Avatar
Andrey Zavyalov, PM

You right. Rows in the Query Columns grid can be removed, reordered, so row index won't help you to cope with your task. Actually, I doubt if it's a good idea at all. You can try to dentify rows by the SQL expression, but it also could be changed by end-user and it might not be unique.


Possibly we'll get back to your idea of improving the QueryTransformer to change SQL expressions of output columns in the future. (I don't know if that task is related to this request)

Avatar
Andrew Kennard

Actually the more I think about the row the trickier it gets.

If there was a "ConditionIndexRow" then there would also need to be a delete row event so I know to shuffle my array of data to match

In that vein I assume an Or column cant be deleted ? ie I would need an event for that to shuffle columns in my stored array

If additional events can't be added then I guess all I can do is store the value of NewExpression on my side when I close the dialog and match that with OldExpression each time I launch my dialog to know which row I am on ? .... But should the user edit the expression in the grid I will have lost my link

Avatar
Andrew Kennard

Thanks very much for this. That is really useful.

However (and this is me being dumb here!) how do I tell which ROW I am on in the grid ?

I thought I could but now I look at it again I can't see an easy way to determine this ?

Avatar
Andrey Zavyalov, PM

The new property ConditionIndex is added to the CustomExpressionEditorParams class.


This fix is included in the newly released version.

Avatar
Andrew Kennard

It indirectly helps in the sense the Expression cell will (?) only ever contain a table.field because someone ticked a box in the design area OR what I have "allowed" in my custom dialog

So having got the SQL property at the end of the process I check through the OutputColumns collection looking for string fields and using my own string manipulation of the SQL string add RTrim in before submitting it to the sql server for execution

I would obviously be more reliable if I could do this within QT :) But in the absence of this facility I can't think of another way around it

As I say I don't this this quite alleviates the need to store meta data against all these cells either in (xml) strings in your control or in our application using references provide by your control

Thanks again !

Avatar
Andrey Zavyalov, PM

This might be possible, but I don't understand how this will help you to add RTrim when user selects a field by checking it in datasource on design area...

Avatar
Andrew Kennard

Thanks very much

Just to add to this I've realised one really needs to know the cell as well as the row.

Yes currently we can tell if it is an Expression or Criteria cell but not WHICH Criteria/Or cell

In connection with the declined request to edit the SQL output fields I will make another hopefully simpler suggestion that would make this request less important too


Avatar
Andrey Zavyalov, PM

Hi,

Thank you for your suggestion.

This is not possible in the current version. We will add your request to our to-do list.