adjective or adverb before ing-form?

Solution 1:

It could be either one, depending on whether "trying" is a noun (then you use "alleged") or a gerund, which is a verb form (then you use "allegedly"). This is because adverbs can't modify nouns, and adjectives can't modify verbs. The ambiguity of structure arises because "-ing" has multiple uses in English, and here, we might be dealing with the "-ing" that derives nouns from verbs or the "-ing" that accompanies gerunds, which are verbs.

Some English speakers might not accept the adjective "alleged" here, because they could be missing a lexical noun "trying". This is a difference between inflectional endings, like the ending in the gerund (which does not change the part of speech), and the derivational ending in the noun "trying". Derivational forms are not basic to the structure of the language -- individuals may differ in whether they are acquainted with specific words in the lexicon.

What is going on is clarified if we change the example so that "trying" has a direct object, since nouns do not take direct objects:

Alice's trying ice cream had left Bob wary of any gourmet foods she might suggest.

Now, you can't use the adjective "alleged".