Self-adjoint bounded operator, resolution of the identity, def. of the diagonal  Let $A$ be a self adjoint bounded linear operator with a continuous spectrum
$\sigma(A)=[a,b]$ which acts on a separable Hilbert space. Let 
$E_\lambda$ be its resolution of the identity. 
For example, $A$  is an operator on $L_2(0,1)$ which acts by multiplication 
$$
A(x(t)):= t \cdot x(t), \ \ \ \sigma(A)=[0,1].
$$
Let $\theta=\{\lambda_0=a, \lambda_1,...,\lambda_n=b\}$ be a decomposition of an interval $[a,b]$ and let
 $B$ be an arbitrary bounded self adjoint operator. Let's consider the sum 
$$
Diag_\theta(B):=\sum_{k=1}^nE_{\Delta_k}\cdot B \cdot E_{\Delta_k}, \ \ 
\text{where} \ \ \Delta_k=\lambda_k-\lambda_{k-1}. 
$$
The question: 
what are the conditions on $B$ for the following sum to exist? 
$$
Diag(B) = \lim_{m(\theta) \to 0}Diag_\theta(B), \ \ \text{where} \ \
 m(\theta)=\max_{1\leq k\leq n} \Delta_k \ 
 $$
Meaning, when the ``diagonal'' of $B$ with respect to $A$ is well-defined?
Clearly if $A$ and $B$ commute  $Diag(B)=B$. Also, if $B$ is compact $Diag(B)=0$. What is known about a general case?
It would suffice to know the answer when $B$ is a projector on an infinite-dimensional subspace. 
Below is the same question in Russian.
Пусть $A$ -- самосопряженный ограниченный оператор с чисто непрерывным спектром
$\sigma(A)=[a,b]$, действующий на сепарабельном гильбертовом пространстве.
Пусть $E_\lambda$ --  его разложение единицы. 
Например, $A$ -- это оператор в $L_2(0,1)$ умножения на аргумент:
$$
A(x(t)):= t \cdot x(t), \ \ \ \sigma(A)=[0,1].
$$
Пусть $\theta=\{\lambda_0=a, \lambda_1,...,\lambda_n=b\}$ -- 
произвольное разбиение отрезка $[a,b]$.
Пусть $B$ -- произвольный ограниченный самосопряженный оператор.
Рассмотрим сумму
$$
Diag_\theta(B):=\sum_{k=1}^nE_{\Delta_k}\cdot B \cdot E_{\Delta_k}, \ \ 
\text{где} \ \ \Delta_k=\lambda_k-\lambda_{k-1}. 
$$
Вопрос: 
для любого ли самосопряженного ограниченного оператора $B$
существует предел
$$
Diag(B) = \lim_{m(\theta) \to 0}Diag_\theta(B), \ \ \text{где} \ \
 m(\theta)=\max_{1\leq k\leq n} \Delta_k \ \text{?}
 $$
Речь идет о существовании "диагонали" \ оператора $B$ относительно оператора $A$.
Очевидно, если операторы $A$ и $B$ коммутируют, то 
  $Diag(B)=B$.
Если $B$ компактный оператор, то $Diag(B)=0$.
Достаточно ответить на поставленный вопрос для проектора $B$
  на бесконечномерное подпространство.
 A: I think the answer to the question, as it is formulated, is "no" (the explanation is below).
However, there may be replacements for your map $Diag$, which we'll discuss at the end.
Let us say that $A$ has spectral multiplicity identically equal to $1$ (i.e., the von Neumann algebra $\mathfrak{A}$ generated by $A$ in the algebra of all bounded operators $B(H)$ on $H$ is maximal abelian).  
Suppose for a contradiction that $Diag(B)$ were defined by your limit procedure for any $B$ in $B(H)$.  Note that $Diag_\theta(B)$ commutes with the projections $E_{\Delta_k}$ coming from the partition $\theta$; using this, I think you can prove that $Diag(B)$ commutes with $\mathfrak{A}$ and thus lies in $\mathfrak{A}$.  You can also note that $Diag$ is a linear map from $B(H)$ to $\mathfrak{A}$ which is actually $\mathfrak{A}$-bilinear: $Diag(X B Y)=X Diag(B) Y$ for any $X,Y\in \mathfrak{A}$ and $B\in B(H)$.  Finally, I think it will be the case that $Diag$ is a normal map, i.e., if $B_i$ is a sequence of uniformly bounded operators, converging weakly to some $B$, then also $Diag(B_i)$ will converge weakly to $Diag(B)$.  
This means that $Diag$ is a normal conditional expectation from $B(H)$ onto $\mathfrak{A}$, which is impossible.  Indeed, for any measure $\mu$ on $[a,b]$ which is abs. continuous wrt the spectral measure of $A$, the formula
$$\tau_\mu (B)=\int Diag(B) d\mu$$ defines a state on $B(H)$ which is (by assumption on normality of $Diag$) normal and thus has the form $\tau_\mu(B)=Tr(B D_\mu)$ for some 
trace-class operator $D_\mu$.  Because of the properties of $Diag$, $\mathfrak{A}$ is in the centralizer of $\tau_\mu$: $$\tau_\mu(X B)=\tau_\mu (B X),\quad \forall X\in \mathfrak{A},\ B\in B(H).$$ Thus $\tau_\mu$ is what is known as a hypertrace. But this entails $D_\mu \in \mathfrak{A}'$ which is impossible (since no trace-class (even compact) operators can commute with a diffuse abelian algebra).  This is a contradiction.
On the positive side, there are (many) non-normal conditional expectations from $B(H)$ onto the algebra $\mathfrak{A}$; so if you don't exactly care for the formula in the definition of your $Diag$, then such "diagonals" exist. In fact, you can choose $E:B(H)\to\mathfrak{A}$ so that, for some choice of unitaries $u_k\in \mathfrak{A}$ going to zero weakly, $E(B)\in \overline{co}(\{u_k B u_k^*\})$ (i.e., $E(B)$ is computed as a kind of "average" over the unitary group of $\mathfrak{A}$.  This is because $\mathfrak{A}$ is abelian and thus amenable.  In fact, $E(B)$ may be called the "virtual diagonal" of $B$ in some literature.
