triggers

What are the different triggers in WPF?

What are the different triggers in WPF? How do they differ and when should I use them? I've seen the following triggers: Trigger DataTrigger MultiTrigger MultiDataTrigger EventTrigger ...

Using binding for the Value property of DataTrigger condition

I'm working on a WPF application and struggling with a data trigger. I'd like to bind the value of the trigger condition to some object I have: <DataTrigger Binding="{Binding Foo}" Value="{Binding ElementName=AnotherElement, Path=Bar}">.. However, I'm not allowed as it doesn't seem to be possible to use bindings for the...

Defining DataTrigger for StackPanel

How do I define a DataTrigger for a StackPanel? It does have a Trigger property, but defining a trigger here gives the following error on Initialize when starting the application: Failed object initialization (ISupportInitialize.EndInit). Triggers collection members must be of type EventTrigger. .... This is given from the follo...

INSERT to a table with a sub query

Can I do this in SQL 2005? SELECT 'C'+inserted.exhid AS ExhId,inserted.exhname AS ExhName,inserted.exhid AS RefID INTO mytable FROM inserted WHERE inserted.altname IS NOT NULL It won't work if the table exists, but will create the table if it is non-existent. How do I get it to insert into an existing table? ...

XAML Styles - how to use BasedOn while overriding triggered setter

I'm using a XAML style to create a custom radio button using my own images. The style uses triggers to change the look of the button based on focus, pressed, etc. Here's the style: <Style x:Key="SmallButtonAsRadioButton" TargetType="RadioButton"> <Setter Property="FocusVisualStyle" Value="{x:Null}" /> <Setter Property="SnapsToDe...

Sql Server trigger insert values from new row into another table

I have a site using the asp.net membership schema. I'd like to set up a trigger on the aspnet_users table that inserted the user_id and the user_name of the new row into another table. How do I go about getting the values from the last insert? I can select by the last date_created but that seems smelly. Is there a better way? ...

How to handle a missing feature of SQLite : disable triggers?

How to handle a missing feature of SQLite: disable triggers? I don't have it stored the name of triggers for a specific table. For example how can I drop all triggers? What would you do? ...

Liquibase - uploading many Oracle triggers in one file

I have a number of Oracle triggers stored in a file which we upload to our DB using sqlplus. We want to use liquibase instead to manage this, but I don't really want to split out the triggers into separate files. The file looks like: create or replace trigger Trig1 ... ... end Trig1; / create or replace trigger Trig2 ... ......

Is it a good idea to put a print a trigger's name when it executes?

We put a print statement at the top, so when we're running a query in SSMS the messages tab shows me that more may be happening than initially meets the eye. Would there be much of a performance hit? ...

track revisions in postgresql

I have to keep track of revisions of records in a table. What I've done is create a second table that inherits from the first and adds a revision counter. CREATE TABLE A ( id SERIAL, foo TEXT, PRIMARY KEY (id)); CREATE TABLE B ( revision INTEGER NOT NULL) INHERITS (A); Then I created a trigger that would update table B everytime A i...

get the latest inserted id in a trigger?

i use a trigger to insert a row and want to use the last created id for using in the subsequent query. how could i do this? the code looks like: BEGIN IF (NEW.counter >= 100) THEN INSERT INTO tagCategories (name, counter) VALUES ('unnamed', NEW.counter); // here i want to have access to the above inserted id UPDATE tagCategories2tagPa...

Trigger errors ORA-04092 ORA-04088

I created a trigger as below: CREATE OR REPLACE TRIGGER trigger_test AFTER INSERT ON trigger_1 FOR EACH ROW DECLARE t_identifier VARCHAR2(10); t_name VARCHAR2(20); BEGIN t_identifier := (:NEW.IDENTIFIER); t_name := (:NEW.NAME); INSERT INTO trigger_2(IDENTIFIER,NAME)VALUES(t_identifier,t_name); COMMIT; END; I am trying to insert a row ...

Postgres: narrowing trigger scope

(Postgres 8.3) I'm working with a DB table X 100+ columns wide (which I can't change sadly) many of which get updated constantly and very frequently by normal business process. I have a requirement to update table Y based on updates to a particular column foo in X updated by unusual business process. However, because of the very high n...

Hook in datatemplate view switch/change

Hello, I am switching my UserControls via DataTemplate. When I leave the UserControl/DataTemplate View I need to ask wether the user wants to save or not because else all data will be lost like graphical location points x,y of a user drag/dropped Rectangle on a canvas. How can I hook into the datatemplate change and bring up my own sav...

Postgres serial value incrementing by 2

I have some tables in my postgres database, and a few of them inherit from each other. For example: CREATE TABLE parent_table(parent_table_id SERIAL PRIMARY KEY, my_col1 VARCHAR(16) NOT NULL, my_timestamp TIMESTAMP WITH TIME ZONE NOT NULL); CREATE TABLE child_table() INHERITS (parent_table); CREATE TABLE step_child_tab...

Raise and consume AttachedEvent on button click

I am trying to raise a custom built attached event on a button click. If I add handlers in the code, they are hit when the button is pressed but if I use the event in a WPF Trigger for animation, it doesn't work. The Triggers that use the custom Attached Event is defined in a ControlTemplate for a CustomControl. The same code works fo...

i want to make a physical button a trigger for a function in my app. Possible? 3rd party accessory?

Hello wise people, I'm currently working on an app for iPhone, Blackberry and Android, but for now, I'm just inquiring about iPhone. (FYI, I'm an ideas guy; not an actual programmer, so please don't use too many syllables) I desperately need the ability to incorporate the physical button from the iPhone headphones, into my app. So that...

Instead Of Delete Trigger with FileStream

Why can't i use an Instead Of Delete Trigger on a table that has a varbinary filestream column? Is there a workaround for it? I want to update a field when a delete command is performed. Thanks ...

Trigger Jquery autocomplete via scripted event on 1.2.6

I'm attempting to trigger Jquery autocomplete from outside the field. I'm running an on screen Jquery keyboard, so the normal keyup keydown events are not fired. I can not use Jquery.Event or trigger() because I'm stuck with Jquery 1.2.6. I am aware there are other onscreen keyboards out there, but all the other ones I've tested have ...

Negate or Not Condition-Element for MultiTrigger

I´m currently learning WPF and the use of MultiTrigger and Conditions to set some properties of the styled control. I know that the Conditions of an MultiTrigger must all met (AND-Operator) to set the value specified by the Setter. But does there exists a Condition if the value is not met (Lets name it a NotCondition). I have a small ex...