A new approach to the use of chromogenic materials in smart windows to optimize the amount of daylight and solar energy indoors is presented. A smart window with a grating optical filter dinamically adapting to the position of the Sun due to parallel strips of chromogenic materials on two surfaces of window pane(s) provides angular filtering of the solar radiation without using the light redistribution devices. Based on methods for calculating optimum slope angle of the strips on the pane(s), their widths and relative position on two surfaces, equations are obtained for calculating the transmittance of the grating filter with chromogenic strips. Angular and temporal characteristics of the transmittance calculated using these equations demonstrate the angular selectivity of a smart window with chromogenic filter compared to a conventional smart window, fully glazed with chromogenic glass. In addition, such a window attenuates the direct solar radiation in a preset angular range and transmits the diffused radiation providing comfortable daylighting and temperature indoors, unlike conventional smart windows which in an active state attenuate not only direct but also diffused radiation.