I have a combox and trying to cast its SelectedItem property to DataRowView like this
DataRowView drFromWareHouse = cmbFromWareHouse.SelectedItem as DataRowView;
but it is showing redline and when I move the Cursor on it. It shows me cmbFromWareHouse does not exist in the current context. Kindly guide me what's going wrong with it?