I have a WPF datagrid and I would like to display a message saying “No Records Found” in the middle of the Datagrid.
One way I can see of doing this is to add a single datarow that spans all the columns and whos height is the height of the datagrid, then centre the text in the row.
The main thing Im struggling with is programatically adding the row to teh datagrid.
Is this possible or is there an easier way to do this?
Put the ‘No Records Found’ message in a
TextBlockinstead, and show/hide theTextBlockdepending on whether theDataGridhas data.EDIT: Source for
BooleanToInverseVisibilityConverter(I have a bunch of handy converters like this always available to me in my WPF projects)