Concept:
3D Geometry - Direction Ratios and Dot Product.
Step 1: Identify the geometric constraint.
Since $\triangle ABC$ is right-angled at vertex A, the side vectors originating from A must be strictly perpendicular. Mathematically, this means the dot product of vector $\overline{AB}$ and vector $\overline{AC}$ must be exactly equal to zero ($\overline{AB}\cdot\overline{AC}=0$).
Step 2: Calculate vector $\overline{AB}$.
The vector from point $A(4,2,x)$ to point $B(3,1,8)$ is found by subtracting the coordinates of A from B: $\overline{AB} = (3-4)\hat{i} + (1-2)\hat{j} + (8-x)\hat{k} = -\hat{i} - \hat{j} + (8-x)\hat{k}$.
Step 3: Calculate vector $\overline{AC}$.
Similarly, the vector from point $A(4,2,x)$ to point $C(2,-1,2)$ is: $\overline{AC} = (2-4)\hat{i} + (-1-2)\hat{j} + (2-x)\hat{k} = -2\hat{i} - 3\hat{j} + (2-x)\hat{k}$.
Step 4: Set up the dot product equation.
Apply the condition $\overline{AB}\cdot\overline{AC}=0$. Multiply the corresponding $\hat{i}$, $\hat{j}$, and $\hat{k}$ components and sum them: $(-1)(-2) + (-1)(-3) + (8-x)(2-x) = 0$. This simplifies to $2 + 3 + (16 - 10x + x^2) = 0$.
Step 5: Solve the resulting quadratic equation.
Combine the constant terms: $x^2 - 10x + 21 = 0$. Factor the quadratic equation: $(x-3)(x-7) = 0$. This gives two possible values for $x$: $x=3$ or $x=7$. Looking at the given options, only $3$ is available.
$$
\therefore \text{The correct value of } x \text{ is } 3.
$$