In the present work we discuss a possibility to build an instrument with two operation modes - spectral and imaging ones. The key element of such instrument is a dispersive and filtering unit consisting of two narrowband volume-phase holographic gratings. Each of them provides high diffraction efficiency in a relatively narrow spectral range of a few tens of nanometers. Besides, the position of this working band is highly dependent on the angle of incidence. So we propose to use a couple of such gratings to implement the two operational modes. The gratings are mounted in a collimated beam one after another. In the spectroscopic mode the gratings are turned on such angle that the diffraction efficiency curves coincide, thus the beams diffracted on the first grating are diffracted twice on the second one and a high-dispersion spectrum in a narrow range is formed. If the collimating and camera lenses are corrected for a wide field it is possible to use a long slit and register the spectra from its different points separately. In the imaging mode the gratings are turned to such angle that the efficiency curves intersect in a very narrow wavelength range. So the beams diffracted on the first grating are filtered out by the second one except of the spectral component, which forms the image. In this case the instrument works without slit diaphragm on the entrance. We provide an example design to illustrate the proposed concept. This optical scheme works in the region around 656 nm with F/# of 6.3. In the spectroscopic mode it provides a spectrum for the region from 641 to 671 nm with reciprocal linear dispersion of 1.4 nm/mm and the spectral resolving power higher than 14000. In the imaging mode it covers linear 12mm x 12mm field of view with spatial resolution of 15-30 lines/mm.